Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Notes on bash(1)
- X-seq: zsh-users 1976
- From: Paul Lew <lew@xxxxxxxxxxxxxxxxxx>
- To: Jason Price <gt5076c@xxxxxxxxxxxxxx>
- Subject: Re: Notes on bash(1)
- Date: Wed, 9 Dec 1998 12:44:46 -0500
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199812091619.LAA15213@xxxxxxxxxxxxxxxxxxxx>
- References: <199812091619.LAA15213@xxxxxxxxxxxxxxxxxxxx>
>>>>> "Jason" == Jason Price <gt5076c@xxxxxxxxxxxxxx> writes:
Jason> there are a heck of a lot of ${...} modifiers that are
Jason> wonderfully useful, but in my searching through the man
Jason> pages, I havn't found an equivelent to basename
Jason> /usr/local/bin/mumble -> mumble. I need to pull the
Jason> basename out of path strings quite offten, and I'd like to
Jason> do so in shell.
Jason> Is this ... (wait, this is zsh) How can I do this?
$ foo=/usr/local/bin/zsh-3.1.5
$ echo $foo:h -- head
/usr/local/bin
$ echo $foo:t -- tail
zsh-3.1.5
$ echo $foo:r -- root
/usr/local/bin/zsh-3.1
$ echo $foo:e -- extension
5
Just like csh can do.
-- Paul 12/09/98 12:43 PM --
Messages sorted by:
Reverse Date,
Date,
Thread,
Author