* 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, other threads:[~2019-10-12 13:01 UTC | newest]
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
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).