Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Notes on bash(1)



>>>>> "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