[CLUE-Tech] Command line order
Kevin Cullis
kevincu at orci.com
Wed Dec 6 10:31:22 MST 2000
Lynn Danielson wrote:
>
> Kevin Cullis wrote:
> > "Jeffery C. Cann" wrote:
> > > On Tuesday 05 December 2000 10:08, Kevin Cullis wrote:
> > > >
> > > > I did the ls -fl AND an ls -lf and got two different displays.
> > >
> > > In general, the order does not matter. I tried cat -vet file and cat -tev
> > > file and observed the same results.
> >
> > Then did you try my stuff and see what happens? I'm now curious as to
> > why this might be happening. Could it be BASH that might cause this?
>
> Kevin, Grant already gave you the answer to this question. The -l and -f
> switches are incompatible. You get the results of one or the other, they
> do not work together. The man page
Aha! Then the new version of Linux in a Nutshell (3rd Ed.) does not say
that, that's what I was refering to first and, yes, the man page does
say -l and -f are "incompatible." Damn documentation/books ;-) At
least the software works!! ;-)
>
> As to why you get different results depending on the switch ordering. I
> can only guess from actually looking at the results. The way GNU ls seems
> to work is -- if there is a conflict between switches the last one wins.
> Therefore, if "ls -lf" is equivalent to "ls -f" and "ls -fl" is equivalent
> to "ls -l". This is not clearly documented in the man or info pages, but
> it's clearly the way it works (at least in this case). The "ls" command is
> not a built-in shell command, so bash has nothing to do with its operation.
>
> On Solaris, the "-f" switch always disables the "-l" switch (among others)
> regardless of the order. This method of operation may make more sense to
> you. But as we all know, GNU's not UNIX.
No problem, I was just trying to understand the concept as to why it may
not have worked since the documentation failed to indicate this.
Thanks Lynn.
Kevin
More information about the clue-tech
mailing list