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

Re: multiple OSes

On Nov 1, 2007, at 12:02 PM, Oliver Kiddle wrote:

Atom Smasher wrote:
i recently had the misfortune being assigned to a project on solaris(-10).

Give it time and you might find it isn't so bad once you get used to it. I wouldn't condemn the whole OS just because you need to add a few extra
things to the default path and don't get a manpath command.

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?

I tend to setup the path separately for different systems

also, i've got this in my ~/.zshrc:
  alias rm="rm -i" # safety first!

In my opinion, this is a very unsafe thing to do. You get used to the -i
option, then one day when you have to use a system that lacks your
personal settings, you will lose some files because you were going to
type no for the files you wanted. It's better to call your alias
something else like ri and get used to it.

which causes a problem on solaris... instead of:
	rm -rf /junk
i have to do this:
	command rm -rf /junk

You can do:
   \rm -rf /junk
Any quoting on an alias prevents alias expansion.


wrt to the path what I do is blank out the PATH var and rebuild it based on directories I know tend to be available on the OSes I use (netbsd, freebsd, ubuntu, os x)

local temp_path
paths=( /bin /usr/bin /usr/pkg/bin /usr/local/bin /sbin /usr/sbin /usr/ local/sbin /usr/pkg/sbin /usr/X11R6/bin /usr/games /opt/local/bin /opt/ local/sbin ~/bin)
for temp_path in $paths
    if [[ -d $temp_path ]]
      if [[ $PATH == "" ]]
unset paths temp_path

this way I keep my path tidy and zsh doesn't bother looking in dirs that don't exist.

--Mike H

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