Re: Bash scripting -- Usage of arrays

2005-11-30 Thread Jayesh Jayan
Hi Marco, Yes you are correct. It is as you have given :) Thank you. On 11/30/05, Marco Gigante <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 30, 2005 at 02:39:15AM +0530, Jayesh Jayan wrote: > > Hi, > > > > Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't > > work. > > > >

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Marco Gigante
On Wed, Nov 30, 2005 at 02:39:15AM +0530, Jayesh Jayan wrote: > Hi, > > Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't > work. > > Below is a sample script which I used. > > ** > > #!/bin/bash > > array=( zero one two

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread John Baldwin
On Tuesday 29 November 2005 04:49 pm, Jayesh Jayan wrote: > Hi John, > > I already have bash installed from ports. It is bash 2.05b. Then use 'bash foo.sh' :) -- John Baldwin <[EMAIL PROTECTED]> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org __

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Jayesh Jayan
Hi John, yes it works when executed with bash aa.sh. Thank you :) On 11/30/05, John-Mark Gurney <[EMAIL PROTECTED]> wrote: > > Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 03:19 +0530: > > I already have bash installed from ports. It is bash 2.05b. > > But below you were running sh, a

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread John-Mark Gurney
Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 03:19 +0530: > I already have bash installed from ports. It is bash 2.05b. But below you were running sh, and not bash... if you do sh array.sh, it will not reinterpet the #!/bin/bash line, and re-exec it with the program in part because /bi

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Jayesh Jayan
Hi Wesley, Thank you. I understood it completely. The explanation was great. Thank you once again. On 11/30/05, Wesley Shields <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 30, 2005 at 02:39:15AM +0530, Jayesh Jayan wrote: > > Hi, > > > > Today I was trying to script using arrays in FreeBSD 5.4

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Jayesh Jayan
Hi John, Thank you. It seems to work like a charm. On 11/30/05, John Baldwin <[EMAIL PROTECTED]> wrote: > > On Tuesday 29 November 2005 04:09 pm, Jayesh Jayan wrote: > > Hi, > > > > Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't > > work. > > > > Below is a sample scrip

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Jayesh Jayan
Hi John, I already have bash installed from ports. It is bash 2.05b. On 11/30/05, John-Mark Gurney <[EMAIL PROTECTED]> wrote: > > Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 02:39 +0530: > > Below is the output. > > > > # sh array.sh > > Install the bash port (as root: pkg_add -r ba

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Wesley Shields
On Wed, Nov 30, 2005 at 02:39:15AM +0530, Jayesh Jayan wrote: > Hi, > > Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't > work. > > Below is a sample script which I used. > > ** > > #!/bin/bash > > array=( zero one two

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread John Baldwin
On Tuesday 29 November 2005 04:09 pm, Jayesh Jayan wrote: > Hi, > > Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't > work. > > Below is a sample script which I used. > > ** > > #!/bin/bash > > array=( zero one two three fo

Re: Bash scripting -- Usage of arrays

2005-11-29 Thread John-Mark Gurney
Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 02:39 +0530: > Below is the output. > > # sh array.sh Install the bash port (as root: pkg_add -r bas), and then try again using bash... FreeBSD doesn't have bash installed by default (and hence, /bin/sh is not bash like it is usually on Lin