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

# Re: multiple OSes

• X-seq: zsh-users 12168
• From: Michael Hernandez <sequethin@xxxxxxxxx>
• To: zsh-users@xxxxxxxxxx
• Subject: Re: multiple OSes
• Date: Thu, 1 Nov 2007 12:24:11 -0400
• Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
• References: <20071101093453.40647.qmail@xxxxxxxxxxx> <23405.1193932961@thecus>


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.

Oliver




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 do if [[ -d$temp_path ]]
then
if [[ $PATH == "" ]] then PATH=$temp_path
else
PATH=$PATH:$temp_path
fi
fi
done
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