in reply to Change directories, Print just the comments
And you don't really need perl at all to do this on *nix -use strict; use warnings; use IO::File; my $f = new IO::File "/etc/services", "r" or die "can not read services file"; while (<$f>) { print "$1\n" if /(#.*)$/; }
grep \# /etc/services | cut -f2 -d#
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (2) Change directories, Print just the comments
by The Mad Hatter (Priest) on Dec 09, 2003 at 00:38 UTC | |
by Roger (Parson) on Dec 09, 2003 at 00:42 UTC | |
by The Mad Hatter (Priest) on Dec 09, 2003 at 00:49 UTC | |
by Roger (Parson) on Dec 09, 2003 at 01:21 UTC | |
by The Mad Hatter (Priest) on Dec 09, 2003 at 03:03 UTC | |
|