perl -e 'open (JUNK, "junk"); while (<JUNK>) { if (/uniqdelimiter/) { if ($value) { $value = 0; } else { $value = 1; } } (print $_) if $value; } }'
or.. in a script: #!/usr/bin/perl -w use strict; my $file = $ARGV[0]; my $value = 0; open(FILE, "$file"); while (<FILE>) { if (/uniqdelimiter/) { if ($value) { $value = 0; } else { $value = 1; } } (print $_) if $value; } On Wed, 7 Apr 2004, Tom Buskey wrote: > Oops, sorry about last post.... > I have a file: > > #!/bin/sh > > command1 > command2 > uniqdelimiter > command3 > command4 > uniqdelimiter > command5 > > I want to filter it and get: > command3 > command4 > > In other words, everything between the lines that say "uniqdelimter". > > This will do it: > sed '0,/^uniqdelimiter/d' file | sed '/^uniqdelimter/d' > > but I'd like a one liner in sed, grep or awk. I'll settle for perl too :-) > > > > _______________________________________________ > gnhlug-discuss mailing list > [EMAIL PROTECTED] > http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss > -- Citation : The number of UNIX installations has grown to 10, with more expected. _The UNIX Programmer's Manual_, Second Edition, June, 1972 _______________________________________________ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss