Re: :t and getting senile.



On Mon, 25 Sep 2006 21:23:23 +0100, Stephane CHAZELAS wrote:
[...]
$var:h in zsh gives the dirname even for the cases where
${var%/*} fails such as when var=foo (not with csh or tcsh).
Same for $var:t vs ${var##*/} when var=/foo/.

I forgot to mention that with zsh, they can also be used in the
globbing qualifiers, as globbing modifiers.

Like:

printf '%s\n' /etc/**/*(:t)

prints the *names* (not paths) of all the files under /etc.

--
Stephane
.



Relevant Pages