Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

sh(1)

BASENAME(1)                          BSD                           BASENAME(1)



NAME
     basename - strip filename affixes

SYNOPSIS
     basename string [ suffix ]

DESCRIPTION
     basename deletes from string any prefix ending in a slash (/) and the
     suffix, if present in string. It then prints the result on the standard
     output.  You normally use the basename command inside substitution marks
     (` `) in shell procedures.

EXAMPLE
     This shell procedure, invoked with the argument /usr/src/bin/cat.c
     compiles the named file and moves the output to cat in the current
     directory:

          cc $1
          mv a.out `basename $1 .c`


SEE ALSO
     csh(1), sh(1)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026