May 2000
Beginner
761 pages
18h 20m
English
basename string [ suffix ] dirname string
basename deletes any prefix ending in / (forward slash) and the suffix (if present in string) from string, and prints the result on the standard output.
1 basename /usr/local/bin 2 scriptname="`basename $0`" |
Explanation
Strips off the prefix /usr/local/ and displays bin.
Assigns just the name of the script, $0, to the variable scriptname.
Read now
Unlock full access