.bashrc .profile .bash_profile

Scott Haneda talklists at newgeo.com
Wed Oct 7 12:38:53 PDT 2009


Very cool.  I had a few functions, but this is a handy one.  I did not  
know I could just set the CLIFORCE_COLOR for the one session.  I also  
like how I believe you pass in the $@, so I can send in arguments to  
my ls alias, which I was not able to do in the past.

Was your use of CLICOLOR_FORCE=X meant literally, or should I use  
boolean?  I have used boolean in the past, and the man page for ls  
does not state what 'X" does, though it does work.

Thank you to all who have contributed to this thread.  What started as  
wonting to know the best way to deal with the .profile that MacPorts  
wants to set, has taught me a lot.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *

On Oct 6, 2009, at 9:41 PM, Derek Harland wrote:

> Hi Scott
>
> If stdout is not a terminal then "ls" disables color information by  
> default.  So if you want to pipe it to anything like grep then you  
> *must* have CLICOLOR_FORCE in the environment.
>
> But as Brandon points out, that can bite you in general ... perhaps  
> you want to define an alias with a different name to ls that does  
> want you want.
>
> For example, here's what my bashrc defines
>
> 	function ll () { command env CLICOLOR_FORCE=X ls -lAFG "$@" | less - 
> R; }
>
> Perhaps you want something like
>
> 	function myls () { command env CLICOLOR_FORCE=X ls -la "$@" | grep - 
> v .DS_Store; }



More information about the macports-users mailing list