From owner-freebsd-questions Mon Feb 4 7:49:28 2002 Delivered-To: freebsd-questions@freebsd.org Received: from relay3-gui.server.ntli.net (relay3-gui.server.ntli.net [194.168.4.200]) by hub.freebsd.org (Postfix) with ESMTP id 4522637B416 for ; Mon, 4 Feb 2002 07:49:25 -0800 (PST) Received: from pc4-card4-0-cust162.cdf.cable.ntl.com ([80.4.14.162] helo=rhadamanth.private.submonkey.net ident=mailnull) by relay3-gui.server.ntli.net with esmtp (Exim 3.03 #2) id 16XlMy-0003cu-00 for questions@freebsd.org; Mon, 04 Feb 2002 15:49:24 +0000 Received: from setantae by rhadamanth.private.submonkey.net with local (Exim 3.34 #1) id 16XlMx-00019S-00 for questions@FreeBSD.org; Mon, 04 Feb 2002 15:49:23 +0000 Date: Mon, 4 Feb 2002 15:49:23 +0000 From: Ceri To: questions@FreeBSD.org Subject: Stupid sh(1) question Message-ID: <20020204154923.GA4312@rhadamanth> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Not directly FreeBSD related, but a good one for Annelise's Linux->FreeBSD question archive. I have a bash script that I wrote that does this : SERVERS[0]="ns1.example.net" SERVERS[1]="doppler.example.net" [..] SERVERS[x]="mail.example.net" and then later : for i in ${SERVERS[@]} do stuff done | ${MAILCMD} -s "${SUBJECT}" ${RECIPIENT} Now, I _have_ read the manpage, but I cannot work out : a) How to initialise an array in sh b) How to access an array in sh. Any enlightenment will be most welcome. Note that RTFM is not a good answer in this case, as I already have - I need a concrete example really. Thanks, Ceri -- keep a mild groove on To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message