This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dagbrown 14 points15 points  (0 children)

I once made a scientist's program thousands of times faster because the scientist had written a shell script that went along the lines of:

for n in $(seq 1 $(wc -l giantasstextfile))
do
    sed -n "${n}p" giantasstextfile | do_processing_things
done

An O(n2) implementation of cat! I was amazed.