Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: .zshrc help...



In the last episode (Jun 16), Will Yardley said:
> just in case, i would like to avoid using something that's
> version-dependent if possible... that seems to work though.

It is portable back to 3.0.7 (the oldest zsh I have).  It was just not
included in distributions until 3.1.6.  The function is small; you can
just stick it at the top of your script.
 
> anyone see a problem with this (assuming that version numbers will
> always be x.x)?
> 
> case $(uname) in
> [...]
>         FreeBSD)
>         MY_REV=$(uname -r | sed "s/-.*//")
>                 if [[ $MY_REV == 4.<6-> ]]; then        
>                 LSCOLORS="dxfxBxcxbxegedabagacad"
>                 else
>                 LSCOLORS="3x5x2x3x1x464301060203"
>                 fi
>         alias ls='ls -GF'
>         export LSCOLORS
>         ;;

You probably want [[ $MY_REV == 4.<6-> || $MY_REV == <5->* ]] to match
-current systems.  Your code also has the side-effect of setting
LSCOLORS on machines that do not cupport colors at all (like FreeBSD
3.5).


-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author