I want to replace a log command in a file and output to another file
my log command can be like
log(xxx);
log ( xxx);
so I use the following
cat input.txt | sed -e '/\s*log\s*\(.*\)/d' > output.txt
however, it also replace the the line with “logical”.
What should I change to make it work.
Thanks
Don’t escape the parentheses; you want them to be literal. (Also, as far as I know sed does not support regex character class shorthand.)