mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Fix mountpoints with spaces on linux
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
This commit is contained in:
parent
60fdd71f74
commit
3925929979
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,8 @@ function __fish_print_mounted --description 'Print mounted devices'
|
|||
if test (uname) = Darwin
|
||||
mount | cut -d " " -f 1-2|tr " " \n|sed -e "s/[0-9\.]*:\//\//"|sgrep "^/"
|
||||
else
|
||||
cat /etc/mtab | cut -d " " -f 1-2|tr " " \n|sed -e "s/[0-9\.]*:\//\//"|sgrep "^/"
|
||||
# In mtab, spaces are replaced by a literal '\040'
|
||||
# So it's safe to get the second "field" and then replace it
|
||||
sed -e "s/[^ ]\+ \([^ ]\+\) .*/\\1/" -e "s/\\040/ /g" /etc/mtab
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue