From 0731b9ef086b033b52fafd94a27b7daad6942b4b Mon Sep 17 00:00:00 2001 From: Moviuro Date: Mon, 15 Sep 2014 12:07:37 +0200 Subject: [PATCH] zshrc: updated OS recognition functions TODO: add more to the list (e.g. *BSDs, Solaris...) --- etc/zsh/zshrc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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? -- 2.1.4