Re: OT: quoting variable names in shell scripts

2011-07-07 Thread Teemu Likonen
* 2011-07-07T07:13:24+02:00 * Javier Barroso wrote: On Thu, Jul 7, 2011 at 5:22 AM, Kamaraju S Kusumanchi raju.mailingli...@gmail.com wrote: Consider the following shell script #! /bin/sh You can use array variables if you want: names=(kama raju k a m a) for i in ${names[@]} Yes, but

Re: OT: quoting variable names in shell scripts

2011-07-07 Thread Javier Barroso
On Thu, Jul 7, 2011 at 10:31 AM, Teemu Likonen tliko...@iki.fi wrote: * 2011-07-07T07:13:24+02:00 * Javier Barroso wrote: On Thu, Jul 7, 2011 at 5:22 AM, Kamaraju S Kusumanchi raju.mailingli...@gmail.com wrote: Consider the following shell script #! /bin/sh You can use array variables if

Re: OT: quoting variable names in shell scripts

2011-07-07 Thread John Hasler
Kamaraju writes: I am wondering if there is a way to rewrite the names variable in stanza2 such that the output from stanza 1 and stanza 2 are the same. I can think of several, but I doubt any will do what you want. What is your actual problem? What are you trying to achieve? -- John Hasler

OT: quoting variable names in shell scripts

2011-07-06 Thread Kamaraju S Kusumanchi
Consider the following shell script $cat manual_listing.sh #! /bin/sh # stanza 1 for i in kama raju k a m a r

Re: OT: quoting variable names in shell scripts

2011-07-06 Thread William Hopkins
On 07/06/11 at 11:22pm, Kamaraju S Kusumanchi wrote: Consider the following shell script $cat manual_listing.sh

Re: OT: quoting variable names in shell scripts

2011-07-06 Thread Javier Barroso
On Thu, Jul 7, 2011 at 5:22 AM, Kamaraju S Kusumanchi raju.mailingli...@gmail.com wrote: Consider the following shell script $cat manual_listing.sh #! /bin/sh # stanza 1 for i in kama raju k a m a r a j u do        echo $i done # stanza 2 names='kama raju' for i in $names do