Why does the following code gives only first line from ps -eaf output in ps.out?
while read line;
do
echo $line>ps.out;
done < <(/bin/ps -eaf)
You are truncating the file each time so you only get the last line. You probably want >>
instead of >
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments