]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: use "command ls" instead of "\ls"
authorKoichi Murase <myoga.murase@gmail.com>
Tue, 3 Jun 2025 13:08:04 +0000 (22:08 +0900)
committerKoichi Murase <myoga.murase@gmail.com>
Tue, 3 Jun 2025 13:39:19 +0000 (22:39 +0900)
The backslash quoting can be used to bypass aliases, but it cannot be
used to bypass shell functions for interactive uses defined by the
users.  We can use "command ls" instead to bypass both aliases and
shell functions.

bash-completion/blkid
bash-completion/mount
bash-completion/umount

index 175f1746d232240cc9ccd643c96b8f8231d1810c..a7e4ef5da22d49ad980990ba78ebf28c3dc8e0ac 100644 (file)
@@ -46,7 +46,7 @@ _blkid_module()
                '-n'|'--match-types')
                        OUTPUT_ALL="
                                $(command awk '{print $NF}' /proc/filesystems)
-                               $(\ls /lib/modules/$(command uname -r)/kernel/fs)
+                               $(command ls /lib/modules/$(command uname -r)/kernel/fs)
                        "
                        ;;
                '-h'|'--help'|'-V'|'--version')
index 268aa3c79ae518be89b92ab21a2a181e64c118b5..6175527d8926d6dc34d11f7af373bd4b3423f2ae 100644 (file)
@@ -8,7 +8,7 @@ _mount_module()
                '-t'|'--types')
                        local prefix realcur TYPES
                        TYPES="
-                               $(\ls /lib/modules/$(command uname -r)/kernel/fs | command awk '{print $1, "no" $1}')
+                               $(command ls /lib/modules/$(command uname -r)/kernel/fs | command awk '{print $1, "no" $1}')
                                $(command awk '{print $NF, "no" $NF}' /proc/filesystems)
                        "
                        realcur="${cur##*,}"
index 3b358d0fcd4df23d08635f3941af450f2d18e844..35e86d9090068f04f9e41f2891f9687358882a5a 100644 (file)
@@ -42,7 +42,7 @@ _umount_module()
                '-t'|'--types')
                        local TYPES
                        TYPES="
-                               $(\ls /lib/modules/$(command uname -r)/kernel/fs | command awk '{print $1, "no" $1}')
+                               $(command 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) )