This command takes a full UNIX path and displays only the last element. It is generally used in scripting. If the optional suffix is supplied and it matches the last element, it is stripped away as well.
Example: Suppose your current working directory is /var/spool/ mail. In that case,
Of course, basename can be used on text strings as well as environment variables, and
would also display
|--help||Display usage information.|
|--version||Display version information.|
This command takes a full UNIX path and displays all but the last element. The command is generally used in scripting.
Example: Suppose you were writing a script that needed ...