mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 04:22:55 +08:00
10 lines
363 B
Fish
10 lines
363 B
Fish
function __fish_print_mounted --description 'Print mounted devices'
|
|
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
|