I am currently storing most of my dotfiles in a git repository to make keeping them in sync across all my computers easier. I've just recently acquired a Macbook so now have to have all my dotfiles supporting the differences between Linux and Darwin. The first incompatability that I have encountered is colour coding
ls, in Linux this is the flag
--color=auto and for Darwin it is
My first attempt at making my
.zshrc portable is to do the following:
case `uname` in Darwin) alias ls='ls -FG' ;; Linux) alias ls='ls -F --color=auto' ;; esac
Once I find a few more things to change I'll probably pull the computer specific stuff out to separate files to keep it a bit cleaner. What I'm mainly wondering is if there is a better way to do this other than using
`uname` to determine which stuff to run.