Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.
""If you don't like the to put < file at the end, you can also pipe the contents of the file to the while loop:""
or just stick at the front
%< foo.sh while IFS= read -r line; do
echo $line;
done
You can't put it in the front because you must put redirections at the end of a compound command. You can put them anywhere in a simple command. Also it should always be echo "$line" not echo $line because of word splitting happening if you don't quote it. I don't get your comment about awk being bogus.
""If you don't like the to put < file at the end, you can also pipe the contents of the file to the while loop:""
or just stick at the front
%< foo.sh while IFS= read -r line; do
echo $line;
done
$ packets=$(echo $info | awk '{ print $1 }')
$ time=$(echo $info | awk '{ print $4 }')
awk is bogus, use cut instead
Comment Responses
You can't put it in the front because you must put redirections at the end of a compound command. You can put them anywhere in a simple command. Also it should always be
echo "$line"
notecho $line
because of word splitting happening if you don't quote it. I don't get your comment about awk being bogus.Reply To This Comment