5、处理/etc/fstab路径,使用sed命令取出其目录名和基名
5、处理/etc/fstab路径,使用sed命令取出其目录名和基名
[17:06:46 root@CentOS8 ~]#echo /etc/fstab
/etc/fstab
[17:07:08 root@CentOS8 ~]#echo /etc/fstab |sed -nr 's#(.*)/([/]+)/?$#\1#p'
[17:09:04 root@CentOS8 ~]#echo /etc/fstab |sed -nr 's#(.*)/([/]+)/?$#\2#p'


浙公网安备 33010602011771号