[TAG] 2cent tip
Joey Prestia
joey at linuxamd.com
Fri Jun 6 20:13:47 MSD 2008
Kapil Hari Paranjape wrote:
> Hello,
>
> On Fri, 06 Jun 2008, Thomas Bonham wrote:
>> I thought I would sure this little perl script that will remove the
>> comments out of a configuration file.
>
> Why not just the following?
>
> grep -v '^#.*' < input > output
>
>
> Kapil.
> --
>
I take it a step farther and make it executable and put it in the path
of system commands like /bin/ and this way it can be called from anywhere.
[joey at xen ~]$ cat /bin/clean
#!/bin/bash
cd $PWD
grep -v '\#' $1 | sed /'^$'/d > $1.clean
--
Joey Prestia
L. G. Mirror Coordinator
Joey at linuxamd.com
http://linuxamd.com
Main Site http://linuxgazette.net
More information about the TAG
mailing list