News for hackers. Stuff that matters.
Re:Useless Use of Cat Award by e12e on Wednesday September 11, 2013 @11:25AM (#6367763)
Wait, what? You mean like this?:

    cat somefile |while read line
    do
      echo $line|cat -|pipe...
    done
Because otherwise I can't see how a pipeline would be started for each line of a datafile ?
Re:Useless Use of Cat Award by cnvogel on Wednesday September 11, 2013 @01:24PM (#6368509)
Sure it's possible without running a subprocess, just open the file on some other filedescriptor.

    exec 5<words.txt
    while read line <&5 ; do
        echo "line read: $line"
    done
    exec <&5-
Re:Useless Use of Cat Award by adestefan on Wednesday September 11, 2013 @12:13PM (#6368072)
It's more common to see this issues with something like this:

   for f in *;
   do
      cat $f | ...
   done
Now make that a directory with thousands of files or a script digs down through through the tree.
Re:Useless Use of Cat Award by e12e on Wednesday September 11, 2013 @01:03PM (#6368371)
But it's not really the "cat" that's the problem here, is it?