You're viewing a comment by Person and its responses.

Person Permalink
June 01, 2012, 17:09

""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

June 01, 2012, 17:38

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.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "linux": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.