From e31f021470f15e57fdf52889d040a28bda81f4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 6 Apr 2011 20:28:19 +0300 Subject: [PATCH] Replace some uname -s checks with $OSTYPE ones. --- completions/crontab | 2 +- completions/findutils | 3 +-- completions/mount | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/completions/crontab b/completions/crontab index 593b4639..e1adc7b9 100644 --- a/completions/crontab +++ b/completions/crontab @@ -16,7 +16,7 @@ _crontab() esac local i opts=" -u -l -r -e" # leading space at start is significant... - [ "$(uname -s)" = Linux ] && opts="$opts -i" + [[ $OSTYPE == *linux* ]] && opts="$opts -i" [ -e /etc/selinux ] && opts="$opts -s" for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do case "${COMP_WORDS[i]}" in diff --git a/completions/findutils b/completions/findutils index 0d87874a..0eb53721 100644 --- a/completions/findutils +++ b/completions/findutils @@ -23,10 +23,9 @@ _find() ;; -fstype) _fstypes - if [[ "$( uname -s )" == *BSD ]] ; then + [[ $OSTYPE == *bsd* ]] && \ COMPREPLY=( "${COMPREPLY[@]}" \ $( compgen -W 'local rdonly' -- "$cur" ) ) - fi return 0 ;; -gid) diff --git a/completions/mount b/completions/mount index 554e744d..65ca8ea5 100644 --- a/completions/mount +++ b/completions/mount @@ -140,7 +140,7 @@ _umount() _get_comp_words_by_ref cur COMPREPLY=() - if [[ $(uname -s) = Linux && -r /proc/mounts ]]; then + if [[ $OSTYPE == *linux* && -r /proc/mounts ]]; then # Linux /proc/mounts is properly quoted. This is important when # unmounting usb devices with pretty names. _linux_fstab < /proc/mounts