Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash remove last directory from path

 path="$(dirname "${path}")/" #ex. /root/path/ | with trailing slash
 path="$(dirname "${path}")"  #ex. /root/path  | without trailing slash
 
PREVIOUS NEXT
Tagged: #bash #remove #directory #path
ADD COMMENT
Topic
Name
7+2 =