zsh-users
 help / color / Atom feed
* Contradictionary behaviour of a script when testing file existance
@ 2019-10-12 12:48 tuxic
  2019-10-12 13:00 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: tuxic @ 2019-10-12 12:48 UTC (permalink / raw)
  To: zsh-users

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'?

Cheers!
mcc



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Contradictionary behaviour of a script when testing file existance
  2019-10-12 12:48 Contradictionary behaviour of a script when testing file existance tuxic
@ 2019-10-12 13:00 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2019-10-12 13:00 UTC (permalink / raw)
  To: zsh-users

On 10/12/19, tuxic@posteo.de <tuxic@posteo.de> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-12 12:48 Contradictionary behaviour of a script when testing file existance tuxic
2019-10-12 13:00 ` Mikael Magnusson

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git