|
Re: patch: use color mode if CLICOLOR is set: msg#00075gnu.core-utils.bugs
Michael Wardle wrote: > I work in a mixed environment of mostly FreeBSD, GNU/Linux, and IRIX > systems. FreeBSD has a color ls that will enter color mode if the -G > option is specified or if the CLICOLOR environment variable is set. GNU > has a color ls that will enter color mode if the --color option is > specified. IRIX does not have a color ls mode. > > In this environment, a simple shell alias such as "ls"="ls --color=auto" > to automatically colorize ls output will not suffice, as non-GNU > versions of ls do not understand the--color option. I prefer the > FreeBSD approach, which is to use color mode if the CLICOLOR environment > variable is set, and if the output is a recognized terminal type, > similar to "--color=tty" in GNU ls. How about something like this in your user shell cusomization? if ls --version 2>/dev/null | grep -q -e fileutils -e coreutils; then eval $(dircolors -b) alias ls='ls --color=auto' elif sometestforbsd; then alias ls='ls -G' fi And, of course, the whole topic of color is one of personal preference. A large can of worms for those who tread there. Bob |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | resubmit: use color ls if $CLICOLOR is set: 00075, Michael Wardle |
|---|---|
| Next by Date: | Re: patch: use color mode if CLICOLOR is set: 00075, Michael Wardle |
| Previous by Thread: | patch: use color mode if CLICOLOR is seti: 00075, Michael Wardle |
| Next by Thread: | Re: patch: use color mode if CLICOLOR is set: 00075, Michael Wardle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |