On 02/28/2017 08:35 AM, L A Walsh wrote:
> Ok, then what about:
> $ var=""
> $ find $var
> ----
> That won't fail w/error, yet its the same idea..., no?
You have to admit that this is a /bad/ script. Even if the writer
intended that behavior falling back to using ".", it would have been
better to explicitly ask for it:
$ test "$var" \
&& find "$var" \
|| find '.'
or at least document that it is using a glitch:
$ find $var # Use $var if set, else use ".".
But the latter would not work for unusual file names, of course.
Have a nice day,
Berny