Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Contradictionary behaviour of a script when testing file existance
- X-seq: zsh-users 24345
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Contradictionary behaviour of a script when testing file existance
- Date: Sat, 12 Oct 2019 15:00:27 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RSxIKP5u8mYrwBtTCKZ69+0hwuo/PqGXiF2iaEuAobQ=; b=Jq+xU4tkiUSCqkFzO2pTo/ouvWoVycKvrosaT+tRXDsUkc+ukzCtqC0nlLJHTbIZNn 9DjsfmM6MjsKcOGL5gj0b0u2Vi5WY7o9RKqWICfy8ZGJDgndmtdODV8c7EGAvyrzvI4l gE6HQ45ZTb96juNWVzUBg/mcx/bDr6idbV0AzK8QW+nAVDP2eOOH5bTBDdGcbnTSGOBT 93/500K0y7KiWr1jgJWnbdklAbODno+mRauJRuihSpqx0+wWHXC/NkZQN4a6hQT/4M9S Bll+hT3rY2DdO23S8FhTPrsKG3OOgcHyVUN32HAboeN2ZvzHXj7mvwrBjwNy8VF3fmvz owxA==
- In-reply-to: <20191012124854.pc4zrlgwgfobl4n6@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20191012124854.pc4zrlgwgfobl4n6@solfire>
On 10/12/19, tuxic@xxxxxxxxx <tuxic@xxxxxxxxx> wrote:
> Hi,
>
> When the script executes this line
>
> if [ -d blender80(:A:t) ] ; then
> ...
> fi
>
> it exits and the error message says, that there is no such file.
> That's why the test is there...I thought... ;)
>
> What do I need to change, that the test successfully tests --
> regardsless whether its result is 'true" or 'false'?
The script exits because a glob fails, you never run the test. Just
remove the useless (:A:t) part and it will be fine, eg
if [ -d blender80 ]; then
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author