nepal nepal.roade at
Wed Jan 27 00:46:34 UTC 2010

On Tuesday 26 Jan 2010 23:39:10 Amedee Van Gasse (ub) wrote:
> On Tue, January 26, 2010 23:12, nepal wrote:
> > On Tuesday 26 Jan 2010 21:03:53 Linda wrote:
> >> Is there a way to make ls silent if there is no match? I'm not
> >>  finding  it in the options, but am hoping I'm just reading over
> >> it in the man page. Thanks
> >>           Linda
> >
> > Hi Linda
> >
> > File a bug report!
> >
> > The correct response to *ls* for a non-existent target should be
> > an empty list.
> Not true. For example:
> amedee at intrepid:~/download$ ls q*
> ls: kan geen toegang krijgen tot q*: Bestand of map bestaat niet
I have no idea what that is supposed to mean? If you say it is not 
true can you *explain* please.

Let me put it another way then, the command "ls" is supposed to return 
a list, that is the meaning of the shortened version of the word list 
(ls). The command is not supposed to make clever comments like I 
cannot find what you asked for. That is not what was asked for. Talk to 
it like it is an idiot. "ls" is a command. I command you (computer) to 
list whatever you find at this location. 

Then fancy options like having a message display upon returned errors 
can be provided to give the user the appropriate level of choice for 
information returned. But the default should be the basic primary 
function which is to return a list of a given location.

> As an alternative, you could use find with xargs and feed that to
>  ls. If find doesn't find anything, nothing will be sent to ls and
>  no output will be produced.
> As an additional advantage, this solves problems when you have
>  directories with thousands or millions of files.
So I maintain that no output should be produced other than the actual 
listing of a location, unless specifically requested by the user.
Actually providing information not asked for is a coder's problem (I 
used to be but happily gave it up), it has now got to the point where 
it has its own name, software bloat.


More information about the ubuntu-users mailing list