Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Something's fishy...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Something's fishy...
Authored by: ebow on Nov 24, '01 09:53:47PM
Okay, I thought I had this mostly figured out, but I guess not... Why does "ls-F" give me a different result from "ls -F" (note the space in the second example)? When I type "ls-F" (no space) I now get color output, but when I type "ls -F" I get the same formatting with no color. The flag -F is just something to get / to appear after folders, and * to appear after "executables" (kinda). Could the reason be buried in the slew of aliases that have been definded between /usr/share/init/tcsh/aliases and ~/Library/init/tcsh/aliases.mine ? The first defines: alias l 'ls -lg' alias ll 'ls -lag !* | more' while the second defines: alias lsm 'ls -F -l!*|more' alias ls 'ls -F' alias l 'ls -F -l ' I know I've redefined "l" in the second, but it doesn't affect this situation. Besides, the 'g' flag does nothing anyway. Anyway, any help on figuring this all out? While using tcsh? What about "ls --color"? That doesn't do anything for me, not even report an error. Is it a bash flag? I don't feel like getting into bash...

[ Reply to This | # ]
Notes on ls-F and ls -F
Authored by: ali on Nov 27, '01 10:13:32AM

You get different results because you actually use different commands.

ls -F calls the ls command (usually in /bin) with the Flag -F so you get the listing with symbols like / (for dir) or @ (for sym link) after every file. See man ls.

ls-F (no space) calls the bultin function of tcsh or bash - not the ls command of /bin. This builtin can't take any additional options in your command line. Alas you can set a tcsh variable called listflags to alter the behavior of ls-F. If you set the variable to a (set listflags = a) ls-F will produce a colored output equivialent to ls -a (note space). See man tcsh.

the --color option does not work as ls is not compiled with this option (afaik). You would need to get the sources and recompile it.

Hope it helps,


[ Reply to This | # ]