April 03, 2009

UNIX case study - 12

You can feed the for loop with the output of a function. Don't say nobody told me!!

generate_list ()
{
echo "one two three"
}

for word in $(generate_list)
do
echo "$word"
done

# one
# two
# three

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.