bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: allowing "" as a path specification for 'current dir' w/o prepe


From: Bernhard Voelker
Subject: Re: RFE: allowing "" as a path specification for 'current dir' w/o prepending './' ?
Date: Tue, 28 Feb 2017 16:45:58 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]