please advice
I have linux and solaris machines, and I need command that work on both OS
I use the following perl line in order to remove all lines that start with "#" why perl command not work ,
remark - need to support also lines that start with space or TAB and then "#"
perl -i -pe 'next if /^ *#/' file
.
more file
# aa a
# bbb
#xxx
this will work on linux maybe also on solaris
EDIT: If \s is not supported maybe this will work...
To do that in file just add
-i
to the commandIf you don't want consecutive multiple blank lines in the result, just pipe it through
uniq