File:  [MW Coherent from dump] / coherent / a / usr / man / COHERENT / basename
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent



basename                     Command                     basename




Strip file name

bbaasseennaammee _f_i_l_e [ _s_u_f_f_i_x ]

basename  strips  its  argument  file  of any  leading  directory
prefixes.  If  the result contains the  optional suffix, basename
also strips it.  basename  prints the result on the standard out-
put.

For example, the command


        basename /usr/fred/source.c


returns


        source.c


basename is  most useful  when it is  used with other  shell com-
mands.  For example, the command


        for i in *.c
        do
                cp $i `basename $i .c`.backup
        done


copies  every file  that has  the suffix  .cc into  an identically
named file that has the suffix .bbaacckkuupp.

***** See Also *****

commands, sh



















COHERENT Lexicon                                           Page 1



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.