Bash scripting -- Usage of arrays
From: Jayesh Jayan (jayesh.freebsdlist_at_gmail.com)
Date: 11/29/05
- Previous message: Warner Losh: "Re: misc questions about the device&driver arch"
- Next in thread: John-Mark Gurney: "Re: Bash scripting -- Usage of arrays"
- Reply: John-Mark Gurney: "Re: Bash scripting -- Usage of arrays"
- Reply: John Baldwin: "Re: Bash scripting -- Usage of arrays"
- Reply: Freddie Cash: "Re: Bash scripting -- Usage of arrays"
- Reply: Marco Gigante: "Re: Bash scripting -- Usage of arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Nov 2005 02:39:15 +0530 To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
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 four);
echo "Elements in array0: ${array[@]}"
******************************************************
It works fine on RedHat server.
Below is the output.
# sh array.sh
Elements in array0: zero one two three four
Below is the out put from the FreeBSD server using the same code.
-bash-2.05b# sh aa.sh
aa.sh: 3: Syntax error: word unexpected (expecting ")")
Please guide me on how to use arrays on freebsd too.
-- Jayesh Jayan "The box said "Requires Windows 95, NT, or better", so I installed Linux." Visit my homepage @ http://www.jayeshjayan.com _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Warner Losh: "Re: misc questions about the device&driver arch"
- Next in thread: John-Mark Gurney: "Re: Bash scripting -- Usage of arrays"
- Reply: John-Mark Gurney: "Re: Bash scripting -- Usage of arrays"
- Reply: John Baldwin: "Re: Bash scripting -- Usage of arrays"
- Reply: Freddie Cash: "Re: Bash scripting -- Usage of arrays"
- Reply: Marco Gigante: "Re: Bash scripting -- Usage of arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|