OT - BASH question?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anyone know of a GOOD bash list? If yes - I'll go there.

The following works:
   while read line; do
   ...
   ...
   done < somefile
   ...
   ...

How would one go about doing something similar replacing the file redirection with the output of a command? Before you say pipe it, that doesn't work because the pipe starts a subprocess and anything done inside the while loop is lost to the rest of the original process.

i.e.
   ps -eo "%p" | while read line; do
   ... # anything done here is
   ... # lost to the original process
   done
   ... # Code here can't use anything
   ... # done inside the while loop

Suggestions?

--
Bill Gradwohl
bill@xxxxxxx
http://www.ycc.com
spamSTOMPER Protected email


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux