I need to run a long piped command in ksh like this
cmd='ps -e -o args | /usr/bin/grep abcde | /usr/bin/grep -v grep'
Then execute this command. And then loop over the results. So I am trying the above line and then
$cmd | while read $arg1 $arg2 ; do
echo $arg1 $arg2
blah $arg1 $arg2
done
And there can be more than two args as well in the result. I am not able to execute this and get the result what I want. Can somebody please suggest what is wrong in this and how i need to correct it.