From: Koichi Murase Date: Tue, 3 Jun 2025 12:50:22 +0000 (+0900) Subject: bash-completion: prefix "command" to other external commands X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=356dd5464b19962af51542a64e5f7c08aa937e96;p=thirdparty%2Futil-linux.git bash-completion: prefix "command" to other external commands --- diff --git a/bash-completion/blkid b/bash-completion/blkid index c5b1ed889..175f1746d 100644 --- a/bash-completion/blkid +++ b/bash-completion/blkid @@ -45,8 +45,8 @@ _blkid_module() ;; '-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') diff --git a/bash-completion/chcpu b/bash-completion/chcpu index 0d96c2532..50b1da4a3 100644 --- a/bash-completion/chcpu +++ b/bash-completion/chcpu @@ -9,7 +9,7 @@ _chcpu_module() 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:-""}" @@ -23,7 +23,7 @@ _chcpu_module() 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:-""}" diff --git a/bash-completion/coresched b/bash-completion/coresched index 4629ab4f1..c2d6f4a89 100644 --- a/bash-completion/coresched +++ b/bash-completion/coresched @@ -14,7 +14,7 @@ _coresched_module() "-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 ;; diff --git a/bash-completion/delpart b/bash-completion/delpart index 12a7e37e7..175bd812f 100644 --- a/bash-completion/delpart +++ b/bash-completion/delpart @@ -17,7 +17,7 @@ _delpart_module() ;; 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 diff --git a/bash-completion/eject b/bash-completion/eject index 27d04656c..c4369c2d3 100644 --- a/bash-completion/eject +++ b/bash-completion/eject @@ -15,7 +15,7 @@ _eject_module() 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') @@ -50,7 +50,7 @@ _eject_module() 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) diff --git a/bash-completion/findmnt b/bash-completion/findmnt index 697691aad..5233e6e63 100644 --- a/bash-completion/findmnt +++ b/bash-completion/findmnt @@ -75,7 +75,7 @@ _findmnt_module() ;; '-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 ;; diff --git a/bash-completion/fsfreeze b/bash-completion/fsfreeze index 05bd68e42..c30dd5659 100644 --- a/bash-completion/fsfreeze +++ b/bash-completion/fsfreeze @@ -17,7 +17,7 @@ _fsfreeze_module() ;; 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 } diff --git a/bash-completion/fstrim b/bash-completion/fstrim index fcb006a54..26b3ab758 100644 --- a/bash-completion/fstrim +++ b/bash-completion/fstrim @@ -32,7 +32,7 @@ _fstrim_module() ;; 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 } diff --git a/bash-completion/ionice b/bash-completion/ionice index 96087270b..4b43dd048 100644 --- a/bash-completion/ionice +++ b/bash-completion/ionice @@ -15,7 +15,7 @@ _ionice_module() ;; '-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 ;; @@ -27,7 +27,7 @@ _ionice_module() ;; '-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 ;; diff --git a/bash-completion/ipcrm b/bash-completion/ipcrm index b5cb95a06..66580558f 100644 --- a/bash-completion/ipcrm +++ b/bash-completion/ipcrm @@ -6,47 +6,47 @@ _ipcrm_module() 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 ;; diff --git a/bash-completion/logger b/bash-completion/logger index 608b85782..37cb78dcf 100644 --- a/bash-completion/logger +++ b/bash-completion/logger @@ -16,7 +16,7 @@ _logger_module() 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') @@ -28,7 +28,7 @@ _logger_module() 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') diff --git a/bash-completion/look b/bash-completion/look index 8bae52c61..e15e7528b 100644 --- a/bash-completion/look +++ b/bash-completion/look @@ -24,7 +24,7 @@ _look_module() 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 \ diff --git a/bash-completion/losetup b/bash-completion/losetup index d20726533..b668782fb 100644 --- a/bash-completion/losetup +++ b/bash-completion/losetup @@ -6,12 +6,12 @@ _losetup_module() 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 ;; diff --git a/bash-completion/lslocks b/bash-completion/lslocks index 97f7d6d92..e70a7418d 100644 --- a/bash-completion/lslocks +++ b/bash-completion/lslocks @@ -9,7 +9,7 @@ _lslocks_module() 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 ;; diff --git a/bash-completion/lslogins b/bash-completion/lslogins index 93c9773b2..f49d264e6 100644 --- a/bash-completion/lslogins +++ b/bash-completion/lslogins @@ -12,11 +12,11 @@ _lslogins_module() " 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') diff --git a/bash-completion/mkswap b/bash-completion/mkswap index 6614884fe..46939c010 100644 --- a/bash-completion/mkswap +++ b/bash-completion/mkswap @@ -18,7 +18,7 @@ _mkswap_module() return 0 ;; '-U'|'--uuid') - COMPREPLY=( $(compgen -W "$(uuidgen -r)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(command uuidgen -r)" -- $cur) ) return 0 ;; '-o'|'--offset') diff --git a/bash-completion/mount b/bash-completion/mount index 430d61d8b..268aa3c79 100644 --- a/bash-completion/mount +++ b/bash-completion/mount @@ -8,8 +8,8 @@ _mount_module() '-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}" @@ -36,7 +36,7 @@ _mount_module() ;; '-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 ;; diff --git a/bash-completion/partx b/bash-completion/partx index 30c9c688d..827cb1508 100644 --- a/bash-completion/partx +++ b/bash-completion/partx @@ -27,7 +27,7 @@ _partx_module() 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') diff --git a/bash-completion/renice b/bash-completion/renice index 88b9ca02d..20ddb9d90 100644 --- a/bash-completion/renice +++ b/bash-completion/renice @@ -7,7 +7,7 @@ _renice_module() 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 ;; diff --git a/bash-completion/resizepart b/bash-completion/resizepart index d980bb45a..d7761dede 100644 --- a/bash-completion/resizepart +++ b/bash-completion/resizepart @@ -17,7 +17,7 @@ _resizepart_module() ;; 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" diff --git a/bash-completion/rfkill b/bash-completion/rfkill index fbaafd2d7..e3a30a8f5 100644 --- a/bash-completion/rfkill +++ b/bash-completion/rfkill @@ -7,7 +7,7 @@ _rfkill_module() 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; ;; diff --git a/bash-completion/rtcwake b/bash-completion/rtcwake index 026729dbb..01b63e6ee 100644 --- a/bash-completion/rtcwake +++ b/bash-completion/rtcwake @@ -18,7 +18,7 @@ _rtcwake_module() return 0 ;; '-m'|'--mode') - COMPREPLY=( $(compgen -W "$(rtcwake --list-modes)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(command rtcwake --list-modes)" -- $cur) ) return 0 ;; '-s'|'--seconds') diff --git a/bash-completion/setpriv b/bash-completion/setpriv index 65f9e4b17..d19b27557 100644 --- a/bash-completion/setpriv +++ b/bash-completion/setpriv @@ -9,7 +9,7 @@ _setpriv_module() 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:-""}" @@ -21,13 +21,13 @@ _setpriv_module() ;; '--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 ;; @@ -35,7 +35,7 @@ _setpriv_module() 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:-""}" diff --git a/bash-completion/su b/bash-completion/su index 6aa084b7f..21e1ca03e 100644 --- a/bash-completion/su +++ b/bash-completion/su @@ -15,7 +15,7 @@ _su_module() return 0 ;; '-s'|'--shell') - COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(command chsh -l)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') diff --git a/bash-completion/swaplabel b/bash-completion/swaplabel index 08aa9cd79..8be5e7739 100644 --- a/bash-completion/swaplabel +++ b/bash-completion/swaplabel @@ -10,7 +10,7 @@ _swaplabel_module() return 0 ;; '-U'|'--uuid') - COMPREPLY=( $(compgen -W '$(uuidgen)' -- $cur) ) + COMPREPLY=( $(compgen -W '$(command uuidgen)' -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') diff --git a/bash-completion/swapoff b/bash-completion/swapoff index 40dcf0569..9b30ac5c6 100644 --- a/bash-completion/swapoff +++ b/bash-completion/swapoff @@ -9,11 +9,11 @@ _swapoff_module() 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') @@ -32,7 +32,7 @@ _swapoff_module() 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 diff --git a/bash-completion/swapon b/bash-completion/swapon index ae74fef5d..8a32d1d96 100644 --- a/bash-completion/swapon +++ b/bash-completion/swapon @@ -27,25 +27,25 @@ _swapon_module() ;; '-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 ;; @@ -77,7 +77,7 @@ _swapon_module() ;; 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 diff --git a/bash-completion/taskset b/bash-completion/taskset index 407edc4ed..30cfc1c3a 100644 --- a/bash-completion/taskset +++ b/bash-completion/taskset @@ -9,7 +9,7 @@ _taskset_module() 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:-""}" diff --git a/bash-completion/umount b/bash-completion/umount index 7650358dd..3b358d0fc 100644 --- a/bash-completion/umount +++ b/bash-completion/umount @@ -3,7 +3,7 @@ _umount_points_list() # 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) @@ -42,8 +42,8 @@ _umount_module() '-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 @@ -53,7 +53,7 @@ _umount_module() ;; '-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 ;; diff --git a/bash-completion/wipefs b/bash-completion/wipefs index 4c1fb4af7..11f9c9daf 100644 --- a/bash-completion/wipefs +++ b/bash-completion/wipefs @@ -29,7 +29,7 @@ _wipefs_module() ;; '-t'|'--types') local TYPES - TYPES="$(blkid -k)" + TYPES="$(command blkid -k)" COMPREPLY=( $(compgen -W "$TYPES" -- $cur) ) return 0 ;; diff --git a/bash-completion/write b/bash-completion/write index 7b2d2fae3..529ec0ad2 100644 --- a/bash-completion/write +++ b/bash-completion/write @@ -11,11 +11,11 @@ _write_module() 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