basename—with a directory name delivers portions of the pathname
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.
Example A.4.
1 basename /usr/local/bin 2 scriptname="'basename $0'" |
EXPLANATION
|
Get UNIX® Shells by Example, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.