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

Re: multiple OSes



Atom Smasher <atom@xxxxxxxxxxx> writes:

> i recently had the misfortune being assigned to a project on
> solaris(-10). having a strong freebsd background and being comfortable on
> linux, i'd have to say that solaris pretty much sucks.
>
> but i'm not here to complain, i'm here to ask a question to those of you
> who use zsh on more than one OS: what's in your ~/.zshrc to set things up
> differently for different OSes?
>
> what i've learned so far on solaris is along these lines (but not yet
> tested):
>
> ## this seems to cause problems on solaris - so don't do it there
> [[ -z "${OSTYPE##solaris*}" ]] || MANPATH=$(manpath 2> /dev/null)
>
> ## why does solaris suck?
> [[ -z "${OSTYPE##solaris*}" ]] && PATH=$PATH/usr/ucb:${HOME}/bin:

My path is a bit huge given all the OSs I've used:

set -A path \
        ~/bin \
        /usr/local/stow/bin \
        /bin /usr/bin/ /usr/X11R6/bin /usr/pkg/bin /sbin /usr/sbin  \
        /usr/local/bin/ /usr/bin \
        /usr/* /usr/local/sbin /usr/local/gphoto/bin \
        /sbin /usr/sbin /usr/X11R6/bin \
        /Volumes/local/pkgsrc/pkg/bin \
        /opt/ghc/bin \
        /usr/kde/3.5/bin \
        ~/{bin,Perl,scripts,haskell,C}

On slowlaris I have an extra
export PATH=$HOME/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/local/bin:$PATH
as well.

> also, i've got this in my ~/.zshrc:
>   alias rm="rm -i" # safety first!
> which causes a problem on solaris... instead of:
> 	rm -rf /junk
> i have to do this:
> 	command rm -rf /junk
>
> is there a better way to assign that alias to rm if i'm on solaris?

Personally I would say get used to the real world where -i doesn't always
exist and therefore should *never* exist. Get used to it - when you type
rm, things disappear ;)

If you want a shorter way to unalias something as a one-off, \rm would work.

And you could always do 
uname | grep SunOS > /dev/null && unalias rm

or adapt your non-working check on OSTYPE above, perhaps?

~Tim
-- 
http://pig.sty.nu/
http://scpt-pics.sty.nu/



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