diff --git a/share/functions/__fish_print_mounted.fish b/share/functions/__fish_print_mounted.fish index 9df25875b..2a390fdb9 100644 --- a/share/functions/__fish_print_mounted.fish +++ b/share/functions/__fish_print_mounted.fish @@ -1,5 +1,5 @@ function __fish_print_mounted --description 'Print mounted devices' - if [ -r /etc/mtab ] + if test -r /etc/mtab # In mtab, spaces are replaced by a literal '\040' # So it's safe to get the second "field" and then replace it # \011 encodes a tab, \012 encodes a newline and \\ encodes a backslash @@ -7,6 +7,6 @@ function __fish_print_mounted --description 'Print mounted devices' # and tabs because of descriptions string replace -r '\S+ (\S+) .*' '$1'