btrfish/utils.fish

19 lines
369 B
Fish
Raw Normal View History

2016-05-05 01:15:35 +02:00
#!/usr/bin/fish
2016-05-05 02:04:21 +02:00
function get-subvol-mounts
#cat /etc/fstab | grep subvol | sed 's/.*subvol=//;s/)//;s/\t\| \|0//g'
cat /etc/fstab | grep btrfs | cut -d\t -f2,4 | sed 's/\(.*\)\t.*,subvol=\(.*\)$/\2 \1/'
end
function get-subvol
echo $argv | cut -d' ' -f1
end
function get-mount
echo $argv | cut -d' ' -f2
2016-05-05 01:15:35 +02:00
end
function clean-name
echo $argv | sed 's/\//-/g'
end