Monday, December 24, 2007

Bash iteration over list with command line argument


<source_code>
#!/bin/bash
LIST="
Anyone
Everyone
Someone
"
for item in ${LIST}
do
echo ${1} ${item} 
done
exit 0;
</source_code>

>./listing.sh hello
hello Anyone
hello Everyone
hello Someone

No comments: