From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 29 21:11:27 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E965C16A428 for ; Tue, 29 Nov 2005 21:11:27 +0000 (GMT) (envelope-from jayesh.freebsdlist@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E9B443DA6 for ; Tue, 29 Nov 2005 21:10:40 +0000 (GMT) (envelope-from jayesh.freebsdlist@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so68906wxc for ; Tue, 29 Nov 2005 13:09:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=euB16SnHgyk8bh4wwnKH7C4HHTyZqDixZTNR2zeviN0KxH9G3Uhac5uPHaTp3RljECSlv+cfxyO7cRQd3Bn/5IfAyFpTAitdzE1pd3umrB1ZMesQI+9Z/dUq0ASxhxSae0s0KKpfqrX7AwGPQ/lHuaL+pBcJrN2mJdIGZIGGYwY= Received: by 10.70.82.3 with SMTP id f3mr209746wxb; Tue, 29 Nov 2005 13:09:15 -0800 (PST) Received: by 10.70.7.2 with HTTP; Tue, 29 Nov 2005 13:09:15 -0800 (PST) Message-ID: Date: Wed, 30 Nov 2005 02:39:15 +0530 From: Jayesh Jayan To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Bash scripting -- Usage of arrays X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2005 21:11:28 -0000 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=3D( 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