I need to create a list of the following script names containg the following.
ftp something
ftp_ascii. something
ftp_binary. somthing
ftp. something
ftp*exe something
but not sftp anything.
The list I first created contained lots of scripts. I noticed some only had ftp or whatever I needed on comment lines only
# ftp .......
echo ftp
cat ftp.log
define ftp_log=rororo
...
I do not need these scripts.
The same with a few other items that can start the line.
Since I only want to generate the list.
I copied all to another subdir --> fixthem
I can do what I want to these scripts in this directory.
I took your advice and removed all lines from scripts the started with [...]# the ... are spaces or tabs
Next removed all lines that started with [....]echo
and down the list. Working with over 10,000 files was very fast on these when UE was asked to remove these lines.
Next I seached for the \s*ftp\S* and found a much cleaner list.
I was getting greedy, or lazy ( regex pun
). trying to do it all in one regex pass.
I still am trying to figure out what lookahead and lookbehind do.
UE worked on these files very fast with the simple regexes. I was finished in under 30 minutes after several removals and tests.
Usually it it is the simple process that makes the most sense. I was so engrossed in making this regex work, I did not think about a simpler solution.
I usually have a hard time with macros in UE, maybe all of this could be done in a macro.
Even using this manual process was much easier than going through over the first set of matches with over 1,000 scripts reporting ftp someting. The list is now down to about 300 real "ftp" scripts.