处理/etc/fstab路径,使用sed命令取出其目录名和基名
取目录 echo "/etc/fstab" |sed -r 's#(^/.*/)([^/]+/?)#\1#' 取基名 echo "/etc/fstab" |sed -r 's#(^/.*/)([^/]+/?)#\2#'
取目录 echo "/etc/fstab" |sed -r 's#(^/.*/)([^/]+/?)#\1#' 取基名 echo "/etc/fstab" |sed -r 's#(^/.*/)([^/]+/?)#\2#'