[svlug] Running a command n times simutaneously

Seth David Schoen schoen at loyalty.org
Tue Apr 25 14:29:43 PDT 2006

Seth David Schoen writes:

> Scott Hess writes:
> > Wow, never heard of seq.  Cool.  Even more portable and less obvious
> > alternative that doesn't use such a special-purpose tool:
> > 
> >    yes | head -10 | egrep -n y | cut -d: -f
> yes | sed '=;10Q;D'

Sorry, I'm wrong to suggest that that's portable.  Non-GNU sed doesn't
understand "Q", but replacing it with "q" gives a spurious output line
at the end.

yes | sed =\;10q | grep -v y

is still shorter than the previous portable alternative.

Seth David Schoen <schoen at loyalty.org> | This is a new focus for the security
     http://www.loyalty.org/~schoen/   | community. The actual user of the PC
     http://vitanuova.loyalty.org/     | [...] is the enemy.
                                       |          -- David Aucsmith, IDF 1999

More information about the svlug mailing list