Replace some uname -s checks with $OSTYPE ones.

This commit is contained in:
Ville Skyttä 2011-04-06 20:28:19 +03:00
parent f0eac44ac9
commit e31f021470
3 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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