You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ggrep "os.execute" is equivalent to grep "os.execute" -r -n | sed 's/:\([0-9]\+\)/ -l \1/g' | sed 's/\([0-9]\+\):/\1 #/g' | sed 's/^\(\w\)/geany \1/g'
How the sed commands above work:
^\(w\) means capture the first word (^: next group must be preceeded by nothing) as a group, and geany \1 means place the "geany " command before that group in the output (and \1: place the first group in the output so it is kept)
(See https://stackoverflow.com/a/31976991/4541104 for the following)
regex operators ((, ), +, w) must be escaped to be used as operators (unless using "-r" but that is only available on GNU sed) otherwise they are treated as literals
\1 must always be escaped (even with -r) to denote that you want to place the first captured group back into the output
[0-9] must be used because GNU sed does not recognize \d for a number.
\+ is for one or more of the preceeding group (capture entire number in this case).
The piping or ggrep both translate the output from something like:
ggrep "os.execute"
is equivalent togrep "os.execute" -r -n | sed 's/:\([0-9]\+\)/ -l \1/g' | sed 's/\([0-9]\+\):/\1 #/g' | sed 's/^\(\w\)/geany \1/g'
How the sed commands above work:
^\(w\)
means capture the first word (^
: next group must be preceeded by nothing) as a group, andgeany \1
means place the "geany " command before that group in the output (and\1
: place the first group in the output so it is kept)(See https://stackoverflow.com/a/31976991/4541104 for the following)
(
,)
,+
,w
) must be escaped to be used as operators (unless using "-r" but that is only available on GNU sed) otherwise they are treated as literals\1
must always be escaped (even with -r) to denote that you want to place the first captured group back into the output[0-9]
must be used because GNU sed does not recognize\d
for a number.\+
is for one or more of the preceeding group (capture entire number in this case).The piping or ggrep both translate the output from something like:
to
and since . is wildcard, all things like os.execute, os_execute, and so on would be found.
The text was updated successfully, but these errors were encountered: