mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
__fish_print_mounted: expand scope on non-Linux platforms
This commit is contained in:
parent
3925929979
commit
78d4f22ce4
@ -1,9 +1,9 @@
|
|||||||
function __fish_print_mounted --description 'Print mounted devices'
|
function __fish_print_mounted --description 'Print mounted devices'
|
||||||
if test (uname) = Darwin
|
if test -r /etc/mtab
|
||||||
mount | cut -d " " -f 1-2|tr " " \n|sed -e "s/[0-9\.]*:\//\//"|sgrep "^/"
|
|
||||||
else
|
|
||||||
# In mtab, spaces are replaced by a literal '\040'
|
# In mtab, spaces are replaced by a literal '\040'
|
||||||
# So it's safe to get the second "field" and then replace it
|
# So it's safe to get the second "field" and then replace it
|
||||||
sed -e "s/[^ ]\+ \([^ ]\+\) .*/\\1/" -e "s/\\040/ /g" /etc/mtab
|
sed -e "s/[^ ]\+ \([^ ]\+\) .*/\\1/" -e "s/\\040/ /g" /etc/mtab
|
||||||
|
else
|
||||||
|
mount | cut -d " " -f 1-3|tr " " \n|sed -e "s/[0-9\.]*:\//\//"|sgrep "^/"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user