Hi Tim,
     I see,  the escape garbage from 'ls --color' in bash scripts will
mess the system up very quickly. 'ls color=auto' is the viable option.
There is also 'ls color=tty' although it is not in man 'ls'

Sorry for not thinking before posting.

'ls' without options in bash scripts ignores the aliases and outputs
normally.

thanks,
Keith.





On Tue, 3 Sep 2002, Timothy Musson wrote:

> On Mon, Sep 02, 2002 at 09:42:04PM +1200, Keith McGavin wrote:
> > ~/.bashrc
>
> > alias ls='ls --color'
> > alias ll='ls -la --color'
>
> I reckon:
>
> alias ls='ls --color=auto'
> alias ll='ls -la'
>
> Have a look at tmp.txt:
>
> /usr/bin/ls --color > tmp.txt
> /usr/bin/ls --color=auto > tmp.txt
>
>
> > These aliases can be put into /etc/profile or /etc/bashrc but xterm
> > wil not display 'ls' dir_color unless ~/bashrc is pointing to those
> > files.
>
> > if [ -f /etc/profile ] ; then
> > . /etc/profile
> > fi
>
> Usually, ~/.bash_profile (or ~/.profile) sources ~/.bashrc - e.g.:
>
> # ~/.bash_profile
>
> if [ -f "~/.bashrc" ]
> then
>   . ~/.bashrc
> fi
>
>
> Tim
> --
> Timothy Musson  -  [EMAIL PROTECTED]
> http://homepages.ihug.co.nz/~trmusson/
> Who messed with my anti-paranoia shot?
>



Reply via email to