Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Functions/Misc/relative: use -q with cd
- X-seq: zsh-workers 41032
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Functions/Misc/relative: use -q with cd
- Date: Sat, 29 Apr 2017 17:07:00 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=mL7X1T94+ZmQBjRbqWuwkaPn18Xhc9ObyGoRxSuN89k=; b=qZPGg6pd aGATYCpb1fQA4OhhJZZBvWKnjhklr4J6A7oo1VaZrvglNct8xdiAWLCiBBNZTiYe 1mo40Z3SSQY6IrQOzd5445qHhj0KlWhbNSE2nl0eUAm8CMkyo7hSqsDfj2F7hcJw T7RPJh5GtsqxJy7IL8Zd9cZ5mah7mWm6+gUAUmeOJqh+lSErrjStZY62XvmF4BRz SjXuODylps7sXc51OreByJzj2AzzsZY3u+AT9zNz0TadrDkzLCB/ienRYARPSsBv hZQ2zq4U6pY7zU4WD3sbXo4FhwN4MGKMm9TgvZRXAFMcyAtI8Wn5zxBrH8VCFW9G 12YogHVd5dHmnQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=mL7X1T94+ZmQBjRbqWuwkaPn18Xhc9ObyGoRxSuN89k=; b=UnNm/DQH WQSDQGYWrF8Q4jI0BMo2Ec8rPw3D/sgkXYjkD374cx1CQ3Yjv4GJj9o0SO44tC5b wfoC/Ti1VvbdMKFfemS6utR3vDpTZdhOautdt89Jx2iZ1rf/rDetM2ryJ1PvNXcb 8kyaKTj/us3rHRV0err72DjnNeIHCDEkzUzNas+RLNrDAdF3EwP9340tO5ILixQR PszH9/QevXLlkCJfmxbakW7EF1WDNNIDV0WAhPnoI5+YXAXoSV7Eg59Ola/95gD/ VzoanUXJq73XcSN1BcMpD1eoceHlnS1uOtrKk/6Or3yK7rvkm8BJKIICGHbVSKws r57tK4vrTkLxsg==
- In-reply-to: <20170427203537.13535-1-genml+zsh-workers@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170427203537.13535-1-genml+zsh-workers@thequod.de>
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