Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Notes on bash(1)
- X-seq: zsh-users 1977
- From: Bruce Stephens <b.stephens@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Notes on bash(1)
- 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)"
- References: <199812091619.LAA15213@xxxxxxxxxxxxxxxxxxxx>
- Sender: B.Stephens@xxxxxxxxx
Jason Price <gt5076c@xxxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author