108 ps --ppid $process | while read -r line ; do
109 #echo $line | awk '{print $1;}
110 child=$($line | awk '{print $1;}')
111 echo $child
113 done
Running this code gives me the following error:
line 111: 3405: command not found
But if I uncomment line 109 it prints the correct value without an error
echo
$line
will be treated as a command to run, apparently the command3405
in your example. – Eric Renouf Nov 27 '16 at 01:52