Re: list files but not directory

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

 



On Sun, 2009-08-23 at 11:18 -0400, Steven W. Orr wrote:
> On 08/22/09 16:46, quoth Mikkel L. Ellertson:

> >> Just remember: "Do one simple thing and do i well." ;-)
> >>
> > And to carry this one step farther, you can create aliases or
> > function to do things you require often. For example, you could use
> > something like this:
> > 
> > function lsp() { ls $@ && less }
> > 
> > so that you could run lsd instead of running "ls | less".
> 
> Two things!
> 
> 1. Bash syntax:
> This will not work:
> function lsp() { ls $@ && less }
> If you do it in one line then it would have to be
> function lsp() { ls $@ && less; }
> 
> If you say ls && less then you will only run the less command if the ls
> command succeeds with a 0 exit status. I know this was a typo but I just
> didn't want others to get confused.
> 
> *NEVER* use $@ without using double quotes. It is very bad luck and failure to
> follow this advise will cause you to send 200 copies of stupid jokes to all
> the people you know with aol addresses. And worse, you will end up knowing
> more aol people.
> 
> What's the difference between an alias and a function? Simple: If you need to
> pass arguments then use a function. I mention this because it's another of
> those basic sources of confusion.
> 

After allowing that there can be "basic sources of confusion" you become
indignant that 'ls' might be a "basic sources of confusion" and are
offended -- from your engineering pedestal -- that someone should want
to discuss it.

> 2. READ THIS BOOK!
> 
> http://catb.org/~esr/writings/taoup/

Looked at it and saved the URL as a valuable reference.

> 
> This discussion has flowed from complaining about how deficient ls is, to how
> people have to learn new paradigms when moving to a new operating system. 

No one complained about how deficient 'ls'.  'ls' has been around for
years and used by millions.  However, the original poster was having
problems getting a 'clean' list of their 'regular files', a fairly
common beginner complaint.  My suggestion boiled down to, if people
expect to find such an option in 'ls' why not give it to them.

Nothing flowed anywhere.  The original poster asked how she could view
her files (i.e. regular files, text files) from the command line.  A few
suggestions followed including my suggestion that the process could be
made easier.

> One
> of the worst things that can happen to a knowledgeable Unix engineer is to
> have him subjected to a windoze weenie telling how to do it right. 

No one was telling anyone how to do anything right.  In fact, as I
re-read the thread, the posts show a tolerant and polite exchange about
why things like 'ls' are, or, are not done a certain way.  If that kind
of exchange annoys you -- ignore it and stay out of it.

To quote myself from a previous post: "Or, maybe, there is just the
natural old pro desire to force an unnecessarily onerous initiation
period on beginners." 

> There's a
> reason that things work and work well in Unix. 

That is like Dad saying "Because I said so."

> Do one simple thing and do it
> well is really just the tip of the iceberg. In fact, Eric did a great job of
> articulating enough stuff to fill an entire book of stuff that all of us
> already know but may not have actually ever articulated. For example, lots of
> people like C++. Lots of people like using threads. One of the cool spotlights
> in the book is why you should be wary of a project that uses both.
> 
> Buy it in a book store, print out your own copy, or read it on line. No matter
> how much you know, reading this is like running lsd for the first time. ;-)
> 
Thank you for the URL.

-- 
Regards Bill
Fedora 11, Gnome 2.26.3
Evo.2.26.3, Emacs 23.1.1

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux