From owner-freebsd-questions@FreeBSD.ORG Tue Nov 29 22:19:17 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DC4416A433 for ; Tue, 29 Nov 2005 22:19:17 +0000 (GMT) (envelope-from jayesh.freebsdlist@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2723B43DBB for ; Tue, 29 Nov 2005 22:18:43 +0000 (GMT) (envelope-from jayesh.freebsdlist@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so86984wxc for ; Tue, 29 Nov 2005 14:18:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=qSWgKvcNHf7n0eNxZvAt0zmOCIHVW2BlZlazynehnAe3JE71l5H0fAKIWz8OpztWRuICbB9G2fpox70+w5Iit+I7QV4SOmI8TsuXOX1TGsZUViIJBCTtPDAPK+iD6G/TWT5lK4xahd6hv+40Cz8xijTjusQoon9pOVI6k0JWkJI= Received: by 10.70.52.19 with SMTP id z19mr2731889wxz; Tue, 29 Nov 2005 14:18:40 -0800 (PST) Received: by 10.70.7.2 with HTTP; Tue, 29 Nov 2005 14:18:40 -0800 (PST) Message-ID: Date: Wed, 30 Nov 2005 03:48:40 +0530 From: Jayesh Jayan To: John-Mark Gurney , Jayesh Jayan , freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org In-Reply-To: <20051129220954.GN885@funkthat.com> MIME-Version: 1.0 References: <20051129212732.GL885@funkthat.com> <20051129220954.GN885@funkthat.com> 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: Re: Bash scripting -- Usage of arrays X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2005 22:19:18 -0000 Hi John, yes it works when executed with bash aa.sh. Thank you :) On 11/30/05, John-Mark Gurney 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, 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 /bin/bash doesn't exist on the system, as bash > is installed in /usr/local/bin/bash... > > Please try with: > bash array.sh > instead, and see if that works.. > > > On 11/30/05, John-Mark Gurney 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 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 Linux), and our sh doesn't have that > > > feature... > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > -- Jayesh Jayan "The box said "Requires Windows 95, NT, or better", so I installed Linux." Visit my homepage @ http://www.jayeshjayan.com