bash - Directory of a file from path -
I have a string of file paths in my shell script.
The path of the directory I want to remove the file part
For example, if the path is: Try: path = "/ var / www / index.html" me
/ var /
Post-text "itemprop =" text ">
~ $ Path = "/ var / www / index.html" ~ $ dir = $ {path% / *} ~ $ $ echo $ dir / var / www
Comments
Post a Comment