coreutils ls color (was: another question...)

Alexander Skwar alexanders.mailinglists+nospam at gmail.com
Tue May 10 11:04:00 PDT 2011


Hi.

On Tue, May 10, 2011 at 16:31, Rodolfo Aramayo <raramayo at gmail.com> wrote:
> Answers below..
>
> --Rodolfo
>
>
>
> On Tue, May 10, 2011 at 09:03, Alexander Skwar
> <alexanders.mailinglists+nospam at gmail.com> wrote:
>>
>> Rodolfo,
>> are you really sure?
>
> It works of that I am sure

That's hard to believe. PS1 changes how the prompt looks
like. Nothing more.

>> Why should PS1 (the prompt value)
>> have anything to do with ls showing color (or not)? There's
>> no connection between those two settings and your, how
>> you call it, "rationale" doesn't explain this.
>
> Again. It works.

I don't believe this.

>> Oh, and BTW: What you discovered is IMO *the* prime
>> reason, why it's a BAD idea to have GNU stuff "too early"
>> in the $PATH. Other ("system") tools might expect a certain
>> behaviour after having figured out the operating system. Hence
>> it's bad to have ls/tar/… way up front, if your not really on a GNU
>> system (which you aren't, when you're on OS X).
>
> You might be right. I am making the assumption that "system" tools will use
> Apple paths whereas MacPorts-installed software will use port paths.

That assumption is flawed. It's much more likely, that scripts call
programs WITHOUT using a complete fixed path; ie. they call
"ls" instead of /bin/ls and that's good so, because scripts don't
know what the user might want or where stuff is at.

> The
> fact that Apple uses PS1 call for example in /etc/bashrc file to control
> Bash behavior gave me the courage to add PS1 calls to my /etc/profile file.
> Remember this is only controlling terminal behavior. But even if it were
> not, I can see how things could go wrong if I were forcing the system to
> JUST use ports compilers, but this is not the case. The programs, ls/tar/
> and so on should not really affect system behavior as in they have the same
> function from those in the system.

No, they don't, as you've shown. For example, the -G option
behaves differently in GNU ls and Apple ls.

> But again, you might be absolutely
> right....and if you are, you shall be the first one to know
>
> Again, ignorance is a bless and I might be heading into catastrophe. At

I'd think so, yes. Overriding system tools is a good way into a
catastrophe.

> least I am having fun while at the wheel...;)

Well, at least something *G*


Alexander
--
↯    Lifestream (Twitter, Blog, …) ↣ http://sup.skwar.me/        ↯
↯ Chat (Jabber/Google Talk) ↣ a.skwar at gmail.com , AIM: alexws77  ↯


More information about the macports-users mailing list