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

Re: [PATCH] Functions/Misc/relative: use -q with cd



Daniel Hahler wrote on Thu, Apr 27, 2017 at 22:35:37 +0200:
> +++ b/Functions/Misc/relative
> @@ -8,8 +8,8 @@ emulate -L zsh || return 1
> -1=$(cd $1; pwd -r)
> -2=$(cd $2; pwd -r)
> +1=$(cd -q $1; pwd -r)
> +2=$(cd -q $2; pwd -r)

Would «1=${1:P}» be equivalent?  (If it is, it saves a fork.)

Pre-existing problem: should the function check that cd succeeded?  It
already checked that $1 and $2 exist, but they might be unreadable/unexecutable
by the EUID.



Messages sorted by: Reverse Date, Date, Thread, Author