Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: /non/existant/path(:h)
- X-seq: zsh-users 12868
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: /non/existant/path(:h)
- Date: Tue, 27 May 2008 10:35:46 +0200
- In-reply-to: <716EA334-6EED-416F-98B1-78EFE3EFA1BA@xxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <716EA334-6EED-416F-98B1-78EFE3EFA1BA@xxxxxxxxxxx>
Sebastian Stark <seb-zsh@xxxxxxxxxxx>:
[...]
> I say this is not exactly true since if you expand:
>
> $myvar(:h)
>
> when myvar contains a path that does not exist it will expand to the
> empty string if nullglob is set or, if nullglob is unset, it will lead
> to an error. This is not very close to a replacement of dirname(1), like
> suggested by the manpage.
[snip]
% foo=/foo/bar/baz.txt
% print ${foo:h}
/foo/bar
[snap]
In the $foo(:h) case, :h is a globbing modifier, which works a bit
differently, if the file does not exist.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author