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

Re: multiple OSes



On Thu, Nov 01, 2007 at 10:34:50PM +1300, Atom Smasher wrote:
[...]
> ## 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:

That's a bit convoluted.

[[ $OSTYPE = solaris* ]]

or

case $OSTYPE in
  (solaris*) ...
  ;;
  (*) ...
  ;;
esac

Also I think you meant
PATH=$PATH:/usr/ucb:${HOME}/bin:

Also, if you'd like Solaris to behave in a more Unixy way, you
could add the Unix PATH in front:

PATH=$(command -p getconf PATH):$PATH:/usr/ucb:${HOME}/bin:

(that might break some scripts though).

> 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?
[...]

zmodload -i zsh/files &&
  disable chown chgrp ln mkdir mv rmdir sync

;)

-- 
Stéphane



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