1

Redirect output of command line to for loop

view story
linux-howto

http://www.unix.com – I would like to redirect output of command line in for loop as $line. Output should be processed as line but instead it throw whole output. Could somebody help me on how to redirect output of command line and process it line by line without sending output to any file. below is my code Code: result=`${HOME}/sqlplus << EOF command select * from xyz; exit EOF` ############################### for line in ${result} do echo $line echo ${result} | grep xxx Now Code: ${HOME}/sqlplus << EOF command select * from xyz; exit produce output like below . (HowTos)