From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4401 invoked from network); 9 Dec 1998 17:30:11 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 9 Dec 1998 17:30:11 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id MAA29017; Wed, 9 Dec 1998 12:25:17 -0500 (EST) Resent-Date: Wed, 9 Dec 1998 12:24:57 -0500 (EST) From: "Bart Schaefer" Message-Id: <981209092342.ZM11340@candle.brasslantern.com> Date: Wed, 9 Dec 1998 09:23:42 -0800 In-Reply-To: <199812091619.LAA15213@gypsy.cad.gatech.edu> Comments: In reply to Jason Price "Re: Notes on bash(1)" (Dec 9, 11:19am) References: <199812091619.LAA15213@gypsy.cad.gatech.edu> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Jason Price , zsh-users@math.gatech.edu Subject: Re: Notes on bash(1) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"_ZnoQ.0.l47.f9hRs"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1975 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Dec 9, 11:19am, Jason Price wrote: } Subject: Re: Notes on bash(1) } } there are a heck of a lot of ${...} modifiers that are wonderfully useful, } but in my searching through the man pages, I havn't found an equivelent to } basename /usr/local/bin/mumble -> mumble. I need to pull the basename out } of path strings quite offten, and I'd like to do so in shell. } } Is this ... (wait, this is zsh) How can I do this? ${${anything::=/usr/local/bin/mumble}:t} where "anything" is any variable name whose value you don't mind replacing with the string "/usr/local/bin/mumble". E.g.: zsh% echo ${${filename::=/usr/local/bin/mumble}:t} mumble zsh% echo $filename /usr/local/bin/mumble zsh% -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com