> The problem: I need to count the number of "bar's" between the "foo's".
> Any help would be GREATLY appreciated.
>

Do you mean 'bar's between the first and last foo'?
Do you have exactly 2 foo's?

Sed seems to be a better choice to multi-line dependencies like this -^.
Remember that Windows versionS are less friendly because of metacharacters.
Try to give for sed a script in "s.

Some tips:
sed "1,/foo/d" - eats lines to the first foo.
sed -n "1,/foo/p" - eats lines after the first foo.
grep -c bar - counts.

mw158979


_______________________________________________
help-gnu-utils mailing list
help-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils

Reply via email to