From owner-freebsd-stable Thu Sep 14 20:51:18 2000 Delivered-To: freebsd-stable@freebsd.org Received: from kwanon.research.canon.com.au (kwanon.research.canon.com.au [203.12.172.254]) by hub.freebsd.org (Postfix) with ESMTP id 745F337B423 for ; Thu, 14 Sep 2000 20:51:15 -0700 (PDT) Received: from bellmann.research.canon.com.au (bellmann.research.canon.com.au [10.5.0.3]) by kwanon.research.canon.com.au (Postfix) with ESMTP id 3EC178A896; Fri, 15 Sep 2000 03:57:48 +0000 (UTC) Received: from elph.research.canon.com.au (elph.research.canon.com.au [203.12.174.253]) by bellmann.research.canon.com.au (Postfix) with ESMTP id 4B6308B10; Fri, 15 Sep 2000 14:45:10 +1100 (EST) Received: from elph.research.canon.com.au (elph.research.canon.com.au [10.2.0.253]) by elph.research.canon.com.au (Postfix) with ESMTP id 817D3132; Fri, 15 Sep 2000 14:50:48 +1100 (EST) Date: Fri, 15 Sep 2000 14:50:48 +1100 (EST) From: Iain Templeton To: Gary Kline Cc: freebsd-stable@FreeBSD.ORG Subject: Re: "set -A" Bourne script - a nogo on FreeBSD In-Reply-To: <200009150325.e8F3Pns34741@thought.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 14 Sep 2000, Gary Kline wrote: > According to Gregory Bond: > > > > > Seems FreeBSD's Bourne shell's "set" command doesn't support -A. > > > > AFAICT "set -A" is a ksh-ism, not a bourne-ism. On my Solaris systems, ksh > > has "set -A", but neither bash nor sh do. Install one of the ksh verisions > > from the ports. > > > > I have a csh or sh question--sorry for asking it this way; > but is there any rational way of turning a file named > > foo.c to foo.o or simply foo with or without calling > non-builtin programs? I think I remember a sh wizard > showing me some bizarre sh command...but not sure it wasn't > a dream! > How about from sh(1) (albeit rather poorly copied) ${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. eg... for i in *.ps do t=${i%.ps} echo $t ~/bin/gs -sOutputFile=$t.ujw $i done Iain Assuming that make foo.o wasn't what you meant To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message