Shell version: fgrep 'blah blah blah' file | head -1 | sed 's/^.*: \([0-9][0-9]*\).*$/\1/' > numberfile
Perl version:
perl -n -e 'if (/blah blah blah/) { s/^.*: ([0-9]+).*$/$1/; print $_;
exit(0); }' < file_with_blah > numberfile
Shell version will fork three processes; the Perl version will fork
one and the Perl version will quit right after it finds the matching
line.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
