Replace some uname -s checks with $OSTYPE ones.
This commit is contained in:
parent
f0eac44ac9
commit
e31f021470
@ -16,7 +16,7 @@ _crontab()
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
local i opts=" -u -l -r -e" # leading space at start is significant...
|
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"
|
[ -e /etc/selinux ] && opts="$opts -s"
|
||||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||||
case "${COMP_WORDS[i]}" in
|
case "${COMP_WORDS[i]}" in
|
||||||
|
@ -23,10 +23,9 @@ _find()
|
|||||||
;;
|
;;
|
||||||
-fstype)
|
-fstype)
|
||||||
_fstypes
|
_fstypes
|
||||||
if [[ "$( uname -s )" == *BSD ]] ; then
|
[[ $OSTYPE == *bsd* ]] && \
|
||||||
COMPREPLY=( "${COMPREPLY[@]}" \
|
COMPREPLY=( "${COMPREPLY[@]}" \
|
||||||
$( compgen -W 'local rdonly' -- "$cur" ) )
|
$( compgen -W 'local rdonly' -- "$cur" ) )
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
-gid)
|
-gid)
|
||||||
|
@ -140,7 +140,7 @@ _umount()
|
|||||||
_get_comp_words_by_ref cur
|
_get_comp_words_by_ref cur
|
||||||
COMPREPLY=()
|
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
|
# Linux /proc/mounts is properly quoted. This is important when
|
||||||
# unmounting usb devices with pretty names.
|
# unmounting usb devices with pretty names.
|
||||||
_linux_fstab < /proc/mounts
|
_linux_fstab < /proc/mounts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user