Bash Удалить последний каталог с пути

 path="$(dirname "${path}")/" #ex. /root/path/ | with trailing slash
 path="$(dirname "${path}")"  #ex. /root/path  | without trailing slash
Brian Patterson