From: Moviuro Date: Mon, 15 Sep 2014 10:07:37 +0000 (+0200) Subject: zshrc: updated OS recognition functions X-Git-Tag: v0.10.0~16 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=0731b9ef086b033b52fafd94a27b7daad6942b4b zshrc: updated OS recognition functions TODO: add more to the list (e.g. *BSDs, Solaris...) --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 295e55d..1b051a5 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -180,14 +180,22 @@ else isgrmlsmall() { return 1 } fi +GRML_OSTYPE=$(uname -s) + +islinux(){ + [[ $GRML_OSTYPE == "Linux" ]] +} + isdarwin(){ - [[ $OSTYPE == darwin* ]] && return 0 - return 1 + [[ $GRML_OSTYPE == "Darwin" ]] } isfreebsd(){ - [[ $OSTYPE == freebsd* ]] && return 0 - return 1 + [[ $GRML_OSTYPE == "FreeBSD" ]] +} + +isopenbsd(){ + [[ $GRML_OSTYPE == "OpenBSD" ]] } #f1# are we running within an utf environment?