Wednesday, April 5, 2017

Bash: Scripting

#!/bin/bash
#
#
generate_list ()
{
        echo "one two three"
}
#
#
for word in $(generate_list)
do
        echo $word
done
exit $?



Result:
$ ./gen_list.sh
one
two
three

No comments:

Post a Comment