fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_print_mounted --description'Print mounted devices' 3if test -r /etc/mtab 4# In mtab, spaces are replaced by a literal '\040' 5# So it's safe to get the second "field" and then replace it 6# \011 encodes a tab, \012 encodes a newline and \\ encodes a backslash 7# This will probably break on newlines because of our splitting, though 8# and tabs because of descriptions 9string replace -r'\S+ (\S+) .*' '$1' < /etc/mtab| string replace -a"\040" " " | string replace -a"\011" \t | string replace -a"\012" \n | string replace -a"\\\\" "\\" 10else 11mount | string replace -r'^(\S+) \S+ (\S+) .*' '$1\n$2' | string replace -r'[\d.]*:/' /| string match'/*' 12end 13end