;;
'-n'|'--match-types')
OUTPUT_ALL="
- $(awk '{print $NF}' /proc/filesystems)
- $(\ls /lib/modules/$(uname -r)/kernel/fs)
+ $(command awk '{print $NF}' /proc/filesystems)
+ $(\ls /lib/modules/$(command uname -r)/kernel/fs)
"
;;
'-h'|'--help'|'-V'|'--version')
local prefix realcur CPULIST_ALL CPULIST
realcur="${cur##*,}"
prefix="${cur%$realcur}"
- CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/offline)
+ CPULIST_ALL=$(command sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/offline)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
CPULIST="$WORD ${CPULIST:-""}"
local prefix realcur CPULIST_ALL CPULIST
realcur="${cur##*,}"
prefix="${cur%$realcur}"
- CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
+ CPULIST_ALL=$(command sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
CPULIST="$WORD ${CPULIST:-""}"
"-s"|"--source"|"-d"|"--dest")
local pids sorted_pids
pids=$(builtin cd /proc && echo [0-9]*)
- sorted_pids=$(echo "${pids[@]}" | tr ' ' '\n' | sort -nr | tr '\n' ' ')
+ sorted_pids=$(echo "${pids[@]}" | command tr ' ' '\n' | command sort -nr | command tr '\n' ' ')
COMPREPLY=( $(compgen -W "$sorted_pids" -- "$2") )
return 0
;;
;;
2)
prev="${COMP_WORDS[COMP_CWORD-1]}"
- COMPREPLY=( $(compgen -W "$(cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) )
;;
esac
return 0
return 0
;;
'-x'|'--cdspeed')
- COMPREPLY=( $(compgen -W "$(eject --listspeed 2>/dev/null)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command eject --listspeed 2>/dev/null)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
esac
local DEVS
DEVS="$(for I in /sys/class/block/*/removable; do
- if [ $(cat $I) -ne 0 ]; then
+ if [ $(command cat $I) -ne 0 ]; then
OLD_IFS=$IFS
IFS='/';
ARR=($I)
;;
'-S'|'--source')
local DEV_MPOINT
- DEV_MPOINT=$($1 -rno SOURCE | grep ^/dev)
+ DEV_MPOINT=$($1 -rno SOURCE | command grep ^/dev)
COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) )
return 0
;;
;;
esac
local MPOINT
- MPOINT="$(findmnt -t ext2,ext3,ext4,reiserfs,jfs,xfs -o TARGET -n -r)"
+ MPOINT="$(command findmnt -t ext2,ext3,ext4,reiserfs,jfs,xfs -o TARGET -n -r)"
COMPREPLY=( $(compgen -W "$MPOINT" -- $cur) )
return 0
}
;;
esac
local MPOINTS
- MPOINTS=$(findmnt -rno SOURCE,TARGET | awk '/^\/dev/{print $2}')
+ MPOINTS=$(command findmnt -rno SOURCE,TARGET | command awk '/^\/dev/{print $2}')
COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) )
return 0
}
;;
'-P'|'--pgid')
local PGID
- PGID="$(awk '{print $5}' /proc/*/stat 2>/dev/null | sort -u)"
+ PGID="$(command awk '{print $5}' /proc/*/stat 2>/dev/null | command sort -u)"
COMPREPLY=( $(compgen -W "$PGID" -- $cur) )
return 0
;;
;;
'-u'|'--uid')
local UIDS
- UIDS="$(stat --format='%u' /proc/[0-9]* | sort -u)"
+ UIDS="$(command stat --format='%u' /proc/[0-9]* | command sort -u)"
COMPREPLY=( $(compgen -W "$UIDS" -- $cur) )
return 0
;;
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-m'|'--shmem-id')
- KEYIDS="$(lsipc -m --noheadings -o ID)"
+ KEYIDS="$(command lsipc -m --noheadings -o ID)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-M'|'--shmem-key')
- KEYIDS="$(lsipc -m --noheadings -o KEY)"
+ KEYIDS="$(command lsipc -m --noheadings -o KEY)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'--posix-shmem')
- KEYIDS="$(lsipc -M --noheadings -o NAME)"
+ KEYIDS="$(command lsipc -M --noheadings -o NAME)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-q'|'--queue-id')
- KEYIDS="$(lsipc -q --noheadings -o ID)"
+ KEYIDS="$(command lsipc -q --noheadings -o ID)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-Q'|'--queue-key')
- KEYIDS="$(lsipc -q --noheadings -o KEY)"
+ KEYIDS="$(command lsipc -q --noheadings -o KEY)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'--posix-mqueue')
- KEYIDS="$(lsipc -Q --noheadings -o NAME)"
+ KEYIDS="$(command lsipc -Q --noheadings -o NAME)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-s'|'--semaphore-id')
- KEYIDS="$(lsipc -s --noheadings -o ID)"
+ KEYIDS="$(command lsipc -s --noheadings -o ID)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-S'|'--semaphore-key')
- KEYIDS="$(lsipc -s --noheadings -o KEY)"
+ KEYIDS="$(command lsipc -s --noheadings -o KEY)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'--posix-semaphore')
- KEYIDS="$(lsipc -S --noheadings -o NAME)"
+ KEYIDS="$(command lsipc -S --noheadings -o NAME)"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
return 0
;;
'-P'|'--port')
- COMPREPLY=( $(compgen -W "$(awk '$1 ~ /^syslog$/ {split($2, a, "/"); print a[1]}' /etc/services)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command awk '$1 ~ /^syslog$/ {split($2, a, "/"); print a[1]}' /etc/services)" -- $cur) )
return 0
;;
'-p'|'--priority')
return 0
;;
'-u'|'--socket')
- COMPREPLY=( $(compgen -W "$(awk '$NF ~ /^\// {print $NF}' /proc/net/unix)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command awk '$NF ~ /^\// {print $NF}' /proc/net/unix)" -- $cur) )
return 0
;;
'--socket-errors')
1)
[ -f /usr/share/dict/words ] || return 0
if [ "$cur" ]; then
- COMPREPLY=( $(compgen -W "$(look "$cur")" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command look "$cur")" -- $cur) )
else
COMPREPLY=( $(compgen -W \
"0 1 2 3 4 5 6 7 8 9 \
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-d'|'--detach')
- ARG="$($1 --output NAME | awk '{if (1 < NR) {print}}')"
+ ARG="$($1 --output NAME | command awk '{if (1 < NR) {print}}')"
COMPREPLY=( $(compgen -W "$ARG" -- $cur) )
return 0
;;
'-j'|'--associated')
- ARG="$($1 --output BACK-FILE | awk '{if (1 < NR) {print}}')"
+ ARG="$($1 --output BACK-FILE | command awk '{if (1 < NR) {print}}')"
COMPREPLY=( $(compgen -W "$ARG" -- $cur) )
return 0
;;
local PIDS
# /proc/locks can have 8 to 9 fields, see commit
# 55c0d16bab8cc84b72bf11cb2fdd8aa6205ac608
- PIDS="$(awk '{print $(NF-3)}' /proc/locks)"
+ PIDS="$(command awk '{print $(NF-3)}' /proc/locks)"
COMPREPLY=( $(compgen -W "$PIDS" -- $cur) )
return 0
;;
"
case $prev in
'-g'|'--groups')
- COMPREPLY=( $(compgen -W "$(getent group | awk -F: '{print $1}')" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command getent group | command awk -F: '{print $1}')" -- $cur) )
return 0
;;
'-l'|'--logins')
- COMPREPLY=( $(compgen -W "$(getent passwd | awk -F: '{print $1}')" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command getent passwd | command awk -F: '{print $1}')" -- $cur) )
return 0
;;
'--time-format')
return 0
;;
'-U'|'--uuid')
- COMPREPLY=( $(compgen -W "$(uuidgen -r)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command uuidgen -r)" -- $cur) )
return 0
;;
'-o'|'--offset')
'-t'|'--types')
local prefix realcur TYPES
TYPES="
- $(\ls /lib/modules/$(uname -r)/kernel/fs | awk '{print $1, "no" $1}')
- $(awk '{print $NF, "no" $NF}' /proc/filesystems)
+ $(\ls /lib/modules/$(command uname -r)/kernel/fs | command awk '{print $1, "no" $1}')
+ $(command awk '{print $NF, "no" $NF}' /proc/filesystems)
"
realcur="${cur##*,}"
prefix="${cur%$realcur}"
;;
'-N'|'--namespace')
local NAMESPACE
- NAMESPACE="$(lsns --type mnt --output PATH --noheadings)"
+ NAMESPACE="$(command lsns --type mnt --output PATH --noheadings)"
COMPREPLY=( $(compgen -W "$NAMESPACE" -- $cur) )
return 0
;;
return 0
;;
'-t'|'--type')
- COMPREPLY=( $(compgen -W "$(partx --list-types)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command partx --list-types)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
case $prev in
'-g'|'--pgrp')
local PGRP
- PGRP=$(ps -ax -opgrp | sed '1d')
+ PGRP=$(command ps -ax -opgrp | command sed '1d')
COMPREPLY=( $(compgen -W "$PGRP" -- $cur) )
return 0
;;
;;
2)
prev="${COMP_WORDS[COMP_CWORD-1]}"
- COMPREPLY=( $(compgen -W "$(cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) )
;;
3)
COMPREPLY="length"
case $prev in
'list'|'block'|'unblock'|'toggle')
local targets
- targets="$(rfkill --output=id,type --noheadings list)"
+ targets="$(command rfkill --output=id,type --noheadings list)"
COMPREPLY=( $(compgen -W "all $targets" -- $cur) )
return 0;
;;
return 0
;;
'-m'|'--mode')
- COMPREPLY=( $(compgen -W "$(rtcwake --list-modes)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command rtcwake --list-modes)" -- $cur) )
return 0
;;
'-s'|'--seconds')
local prefix realcur INHERIT_ALL INHERIT
realcur="${cur##*,}"
prefix="${cur%$realcur}"
- INHERIT_ALL=$($1 --list-caps| awk '{print $1, "-" $1}')
+ INHERIT_ALL=$($1 --list-caps| command awk '{print $1, "-" $1}')
for WORD in $INHERIT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
INHERIT="$WORD ${INHERIT:-""}"
;;
'--ruid'|'--euid'|'--reuid')
local UIDS
- UIDS=$(getent passwd | awk -F: '{print $1}')
+ UIDS=$(command getent passwd | command awk -F: '{print $1}')
COMPREPLY=( $(compgen -W "$UIDS" -- $cur) )
return 0
;;
'--rgid'|'--egid'|'--regid')
local GIDS
- GIDS=$(getent group | awk -F: '{print $1}')
+ GIDS=$(command getent group | command awk -F: '{print $1}')
COMPREPLY=( $(compgen -W "$GIDS" -- $cur) )
return 0
;;
local prefix realcur GIDS_ALL GIDS
realcur="${cur##*,}"
prefix="${cur%$realcur}"
- GIDS_ALL=$(getent group | awk -F: '{print $3}')
+ GIDS_ALL=$(command getent group | command awk -F: '{print $3}')
for WORD in $GIDS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
GIDS="$WORD ${GIDS:-""}"
return 0
;;
'-s'|'--shell')
- COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command chsh -l)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
'-U'|'--uuid')
- COMPREPLY=( $(compgen -W '$(uuidgen)' -- $cur) )
+ COMPREPLY=( $(compgen -W '$(command uuidgen)' -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
'-U'|'UUID=')
- COMPREPLY=( $(compgen -W "$(swapon --show=UUID --noheading)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command swapon --show=UUID --noheading)" -- $cur) )
return 0
;;
'-L'|'LABEL=')
- COMPREPLY=( $(compgen -W "$(swapon --show=LABEL --noheading)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command swapon --show=LABEL --noheading)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
- COMPREPLY=( $(compgen -W "$(swapon --show=NAME --raw --noheading)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command swapon --show=NAME --raw --noheading)" -- $cur) )
return 0
}
complete -F _swapoff_module swapoff
;;
'-U'|'UUID=')
local UUIDS
- UUIDS="$(command lsblk -nrp -o FSTYPE,UUID | awk '$1 ~ /swap/ { print $2 }')"
+ UUIDS="$(command lsblk -nrp -o FSTYPE,UUID | command awk '$1 ~ /swap/ { print $2 }')"
COMPREPLY=( $(compgen -W "$UUIDS" -- $cur) )
return 0
;;
'-L'|'LABEL=')
local LABELS
- LABELS="$(command lsblk -nrp -o FSTYPE,LABEL | awk '$1 ~ /swap/ { print $2 }')"
+ LABELS="$(command lsblk -nrp -o FSTYPE,LABEL | command awk '$1 ~ /swap/ { print $2 }')"
COMPREPLY=( $(compgen -W "$LABELS" -- $cur) )
return 0
;;
'PARTUUID=')
local PARTUUIDS
- PARTUUIDS="$(command lsblk -nrp -o FSTYPE,PARTUUID | awk '$1 ~ /swap/ { print $2 }')"
+ PARTUUIDS="$(command lsblk -nrp -o FSTYPE,PARTUUID | command awk '$1 ~ /swap/ { print $2 }')"
COMPREPLY=( $(compgen -W "$PARTUUIDS" -- $cur) )
return 0
;;
'PARTLABEL=')
local PARTLABELS
- PARTLABELS="$(command lsblk -nrp -o FSTYPE,PARTLABEL | awk '$1 ~ /swap/ { print $2 }')"
+ PARTLABELS="$(command lsblk -nrp -o FSTYPE,PARTLABEL | command awk '$1 ~ /swap/ { print $2 }')"
COMPREPLY=( $(compgen -W "$PARTLABELS" -- $cur) )
return 0
;;
;;
esac
local DEVS
- DEVS="$(command lsblk -nrp -o FSTYPE,NAME | awk '$1 ~ /swap/ { print $2 }')"
+ DEVS="$(command lsblk -nrp -o FSTYPE,NAME | command awk '$1 ~ /swap/ { print $2 }')"
compopt -o nospace
COMPREPLY=( $(compgen -fW "$DEVS LABEL= UUID= PARTLABEL= PARTUUID=" -- $cur) )
return 0
local prefix realcur CPULIST_ALL CPULIST
realcur="${cur##*,}"
prefix="${cur%$realcur}"
- CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
+ CPULIST_ALL=$(command sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
CPULIST="$WORD ${CPULIST:-""}"
# List of characters to escape shamelessly stolen from "scp" completion
local escape_chars='[][(){}<>\",:;^&!$=?`|\\'\'' \t\f\n\r\v]'
- findmnt -lno TARGET | awk '
+ command findmnt -lno TARGET | command awk '
function literal_ere(s) {
gsub(/[][^$.*?+{}\\()|]/, "\\\\&", s)
'-t'|'--types')
local TYPES
TYPES="
- $(\ls /lib/modules/$(uname -r)/kernel/fs | awk '{print $1, "no" $1}')
- $(awk '{print $NF, "no" $NF}' /proc/filesystems)
+ $(\ls /lib/modules/$(command uname -r)/kernel/fs | command awk '{print $1, "no" $1}')
+ $(command awk '{print $NF, "no" $NF}' /proc/filesystems)
"
COMPREPLY=( $(compgen -W "$TYPES" -- $cur) )
return 0
;;
'-N'|'--namespace')
local NAMESPACE
- NAMESPACE="$(lsns --type mnt --output PATH --noheadings)"
+ NAMESPACE="$(command lsns --type mnt --output PATH --noheadings)"
COMPREPLY=( $(compgen -W "$NAMESPACE" -- $cur) )
return 0
;;
;;
'-t'|'--types')
local TYPES
- TYPES="$(blkid -k)"
+ TYPES="$(command blkid -k)"
COMPREPLY=( $(compgen -W "$TYPES" -- $cur) )
return 0
;;
esac
case $COMP_CWORD in
1)
- COMPREPLY=( $(compgen -W '$(users)' -- $cur) )
+ COMPREPLY=( $(compgen -W '$(command users)' -- $cur) )
return 0
;;
2)
- COMPREPLY=( $(compgen -W "$(w -h $prev | awk '{print $2}')" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(command w -h $prev | command awk '{print $2}')" -- $cur) )
return 0
;;
esac