[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash scripting question



On Sat, Nov 02, 2002 at 10:51:00PM -0500, Neal Lippman wrote:
> shell variable to the alphabet string (export alpha="A,B,C,...,Z"), but
> then the command:
> 	for x in {$alpha} ; 
> 	do
> 		echo $x;
> 	done
> winds up printing the string "{A,B,C,...,Z}" rather than each letter on
> a separate line as expected.

alpha="a b c d e .... z"
for x in $alpha ; do
        echo $x
done

I think this should work in any Bourne-style shell....

-- 
Michael Heironimus



Reply to: