[NTLUG:Discuss] bash question: executing a list of commands

Robert Citek rwcitek at alum.calberkeley.org
Mon Feb 23 00:39:21 CST 2004


On Sunday, February 22, 2004, at 09:45  PM, Lance Simmons wrote:
> How do I execute the lines of foo in order?  I've tried
>
> 	for i in `cat foo`; do "$i"; done
> 	for i in "`cat foo`"; do "$i"; done

cat foo | while read command ; do
   echo == $command
   $command
done

Or simply:
   cat foo | sh

Or more simply:
   source foo

Regards,
- Robert




More information about the Discuss mailing list