4.3BSD-Reno/share/man/cat1/basename.0

Compare this file to the similar file:
Show the results in this format:

()									    ()

NNAAMMEE
     bbaasseennaammee, ddiirrnnaammee - return filename or directory portion of pathname

SSYYNNOOPPSSIISS
     bbaasseennaammee _s_t_r_i_n_g [_s_u_f_f_i_x]
     ddiirrnnaammee _s_t_r_i_n_g

DDEESSCCRRIIPPTTIIOONN
     BBaasseennaammee deletes any prefix ending with the last slash `/' character
     present in _s_t_r_i_n_g, and a _s_u_f_f_i_x, if given.  The resulting filename is
     written to the standard output.  If _s_t_r_i_n_g ends in the slash character,
     `/', or is the same as the _s_u_f_f_i_x argument, a newline is output.  A non-
     existant suffix is ignored.

     DDiirrnnaammee deletes the filename portion, beginning with the last slash `/'
     character to the end of _s_t_r_i_n_g, and writes the result to the standard
     output.

EEXXAAMMPPLLEESS
     The following line sets the shell variable FOO to /_u_s_r/_b_i_n.

	   FOO=`dirname /usr/bin/trail`

     Both the bbaasseennaammee and ddiirrnnaammee exit 0 on success, and >0 if an error oc-
     curs.

SSEEEE AALLSSOO
     csh(1) sh(1)

SSTTAANNDDAARRDDSS
     The bbaasseennaammee and ddiirrnnaammee functions are expected to be POSIX 1003.2 compa-
     tible.