aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_mounted.fish
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2015-07-24 18:35:10 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2015-07-24 18:35:10 +0800
commit78d4f22ce4cc017a9955c02b42f5d653a3b43f5f (patch)
treecf4c513ce611331a9fe073687fe55c0f8a7bdaf6 /share/functions/__fish_print_mounted.fish
parent3925929979d0c6f57d41443472b2e2ffc89652f7 (diff)
__fish_print_mounted: expand scope on non-Linux platforms
Diffstat (limited to 'share/functions/__fish_print_mounted.fish')
-rw-r--r--share/functions/__fish_print_mounted.fish6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/functions/__fish_print_mounted.fish b/share/functions/__fish_print_mounted.fish
index 6c7852fa..f3316161 100644
--- a/share/functions/__fish_print_mounted.fish
+++ b/share/functions/__fish_print_mounted.fish
@@ -1,9 +1,9 @@
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
+ 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
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