Adding to the front of a line

Florian Diesch diesch at
Tue Jan 20 11:37:08 UTC 2009

Matthew Flaschen <matthew.flaschen at> wrote:

> Cameron Hutchison wrote:
>> If the file is not very big, looping in bash will work ok, but once you
>> start dealing with larger files, you really want to use other tools than
>> bash loops. 
> I doubt you'll get any noticeable performance difference.  The bash
> script I gave does not fork any external processes.

But shell code is interpreted while sed is native code.

Using "seq 1 1000000 " as input the shell codes needs about 18s here
while sed needs about 7s.

**  Hi! I'm a signature virus! Copy me into your signature, please!  **

More information about the ubuntu-users mailing list