Get drectory name or file name using shell

Posted on December 19, 2007 by ZDima.
Categories: UNIX, UNIX-Shell.

Don’t have basename or dirname?

Don’t want to start another process every time you need a path?

Not a problem.

dirname == ${path%/*}

basename == ${path##*/}

no comments yet.

Leave a comment

Names and email addresses are required (email addresses aren't displayed), url's are optional.

Comments may contain the following xhtml tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>