RDK wrote:grep -ve ^# -ve ‘^;’ -ve ^$ smb.confcopy> smb.confclean
In the recipe that you found, there were obviously supposed to be ASCII single quotes around ^; to protect the semicolon from the shell. Something along the way has converted them into Unicode left- and right- single quotes, which no longer serve the purpose. So you have two commands separated by semicolon:
Code: Select all
grep -ve ^# -ve ‘^;
’ -ve ^$ smb.confcopy> smb.confclean
The first grep is reading from standard input, so it waits for you to press Ctrl+D or Ctrl+C. The second "command" is nonsense.
With the correct quotes (and running in a root shell as RaTTuS explains) the command should work (though it is redundant to give the -v option three times).
Richard-TX wrote:cat smb.conf | grep -ve ^# -ve \.^\;\. -ve ^$ > outfile
You have quoted the semicolon adequately, but what are the \. for? The beginning of line (^) cannot match
after ., so your version does not remove ; comments.