From owner-freebsd-questions@FreeBSD.ORG Thu May 11 20:30:38 2006 Return-Path: X-Original-To: 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 B558116A47B for ; Thu, 11 May 2006 20:30:38 +0000 (UTC) (envelope-from danielby@slightlystrange.org) Received: from catflap.slightlystrange.org (cpc6-cmbg1-0-0-cust82.cmbg.cable.ntl.com [82.10.236.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A49F44684 for ; Thu, 11 May 2006 19:57:53 +0000 (GMT) (envelope-from danielby@slightlystrange.org) Received: from danielby by catflap.slightlystrange.org with local (Exim 4.62 #0) id 1FeHIE-0007VL-GN by authid for ; Thu, 11 May 2006 20:57:50 +0100 Date: Thu, 11 May 2006 20:57:50 +0100 From: Daniel Bye To: questions@freebsd.org Message-ID: <20060511195750.GE5531@catflap.slightlystrange.org> Mail-Followup-To: questions@freebsd.org References: <63874.209.103.215.99.1147376414.squirrel@email.polands.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline In-Reply-To: <63874.209.103.215.99.1147376414.squirrel@email.polands.org> User-Agent: Mutt/1.4.2.1i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: danielby@slightlystrange.org X-SA-Exim-Scanned: No (on catflap.slightlystrange.org); SAEximRunCond expanded to false Cc: Subject: Re: Bourne shell scripting resources X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2006 20:30:51 -0000 --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 11, 2006 at 02:40:14PM -0500, Doug Poland wrote: > Hello, >=20 > Can someone point me to a good on-line reference for Bourne shell > scripting? I've come across some syntax I don't understand and, since > I don't understand it, don't know how to search the web for it. >=20 > For example, what do these special variable characters do? >=20 > ${UNISON_SCHED%% *} # what does %% * do? > ${UNISON_JOB%\.*} # what does %\.* do? The man page is a good start ;-) Here's what is has to say about your questions: ${parameter%word} Remove Smallest Suffix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the smallest portion of the suffix matched by the pattern deleted. ${parameter%%word} Remove Largest Suffix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the largest portion of the suffix matched by the pattern deleted. In the second case, '\.*' is a shell file glob pattern. You might also find this site interesting/useful: http://www.shelldorado.com/ HTH Dan --=20 Daniel Bye PGP Key: http://www.slightlystrange.org/pgpkey-dan.asc PGP Key fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --10jrOL3x2xqLmOsH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEY5c+ixf5fBYiFmoRAsh8AKCLSRnWEzwjs8Ft8eeN7djIC8KeYQCdEpnL jVYZ9Y/gauyV66glslr/51o= =GUrZ -----END PGP SIGNATURE----- --10jrOL3x2xqLmOsH--