[kwlug-disc] BASH script and config file
Richard Weait
richard at weait.com
Fri Apr 24 17:03:43 EDT 2009
On Fri, 2009-04-24 at 15:13 -0400, john at netdirect.ca wrote:
> It really depends on what you want to do. Grep can be used to extract
> unwanted lines:
>
> egrep -v '(^#|^;|^\b*$)' | sed 's/;.*$//;s/#.*$//' | ( while read line
> do
> echo $line
> done )
>
> Be aware that the sed command strips out all after the *first* semi-colon or hash.
Thanks John, works great.
I added my filename at the end of the egrep and changed the \b to \w to
get rid of a couple of blank lines from my test config file.
Wow 23 minutes. Free Software communities are great.
More information about the kwlug-disc
mailing list