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

Re: multiple OSes

On Thu, 1 Nov 2007, Pete Johns wrote:

I tend to do things per host (since each of the hosts at work is so different).

I have this inside my .zshrc:

if [[ -r ${ZDOTDIR}/.zshrc.${HOST%%.*} ]]; then
 source ${ZDOTDIR}/.zshrc.${HOST%%.*}

I then have separate files for each host ($ZDOTDIR/.zshrc.somehost) which do just the things specific to that host; paths and so on.

If you wanted to do this per OS, you could modify this either using $OSTYPE or the output of `uname`.

including comments, my zshrc is currently 430 lines, 15KB. i'm (currently) subscribing to the theory that it's best to have one file that i use for all logins on all systems, and make it adapt itself accordingly. the alternative is re-writing little peices for different systems and trying to keep them in sync.

the only thing i have doubts about is that the $OSTYPE is determined at compile time, not run time. there's potential for that to cause weird problems, but nothing that would be fixed by ${ZDOTDIR}/.zshrc.${HOST%%.*}.


 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808

	"If we don't stop extending our troops all around the
	 world in nation-building missions, then we're going
	 to have a serious problem coming down the road."
		-- George W. Bush, to Al Gore, during Campaign 2000.

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