From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8022 invoked from network); 10 Dec 1998 23:42:21 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (7795@203.24.36.3) by ns1.primenet.com.au with SMTP; 10 Dec 1998 23:42:21 -0000 Received: (qmail 11902 invoked from network); 10 Dec 1998 11:05:18 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns2.primenet.com.au with SMTP; 10 Dec 1998 11:05:18 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id FAA19959; Thu, 10 Dec 1998 05:57:05 -0500 (EST) Resent-Date: Thu, 10 Dec 1998 05:56:59 -0500 (EST) Sender: B.Stephens@isode.com To: zsh-users@math.gatech.edu Subject: Re: Notes on bash(1) References: <199812091619.LAA15213@gypsy.cad.gatech.edu> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII From: Bruce Stephens Date: 10 Dec 1998 10:45:32 +0000 In-Reply-To: Jason Price's message of "Wed, 9 Dec 1998 11:19:27 -0500 (EST)" Message-ID: X-Mailer: Gnus v5.6.27/XEmacs 20.4 - "Emerald" Resent-Message-ID: <"S-aSg.0.Ut4.xZwRs"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1977 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Jason Price writes: > 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? Personally, I use ## and %% operators for this: i=/usr/local/bin/mumble echo ${i##*/} prints mumble. This also works in bash and ksh.