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

Re: Contradictionary behaviour of a script when testing file existance



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