return filename portion of pathname
Project description
Installation
pip install pnu-basename
BASENAME(1)
NAME
basename - return filename portion of pathname
SYNOPSIS
basename string [suffix]
basename [-a] [-s suffix] [-z] string [...]
DESCRIPTION
The basename utility deletes any prefix ending with the last slash character ('/' under Unix-like Operating Systems or '\' under Windows operating Systems) present in string (after first stripping trailing slashes), and a suffix, if given. The suffix is not stripped if it is identical to the remaining characters in string. The resulting filename is written to the standard output. A non-existent suffix is ignored. If -a is specified, then every argument is treated as a string as if basename were invoked with just one argument. If -s is specified, then the suffix is taken as its argument, and all other arguments are treated as a string.
OPTIONS
Options | Use |
---|---|
-a|--multiple | Support multiple arguments and treat each as a name |
-d|--debug | Enable debug mode |
-h|--help|-? | Print usage and a short help message and exit |
-s|--suffix SUFFIX | Remove trailing SUFFIX. Implies -a |
-v|--version | Print version and exit |
-z|--zero | End each output line with NUL, not newline |
-- | Options processing terminator. |
ENVIRONMENT
As the original FreeBSD basename command, this version does not take the POSIXLY_CORRECT environment variable into account.
EXIT STATUS
The basename utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
dirname(1), csh(1), sh(1), basename(3), dirname(3)
STANDARDS
The basename utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
This version is fully compatible with the FreeBSD version (apart from the invalid option error message). It also implements the GNU coreutils version specific options.
It tries to follow the PEP 8 style guide for Python code.
PORTABILITY
Tested OK under Windows (though with backslashes instead os slashes, of course).
HISTORY
The basename utility first appeared in 4.4BSD.
This version was made for The PNU project / PyNIX in order to test the b2bt command.
LICENSE
This utility is available under the 3-clause BSD license.
AUTHORS
This version was written by Hubert Tournier
The man page is derived from the FreeBSD project's one.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pnu_basename-1.0.2.tar.gz
.
File metadata
- Download URL: pnu_basename-1.0.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82e16d40fe9ff6db9255be60d7d99bb0ab8f0ebe87f6eb98394d6089da7fbeb7 |
|
MD5 | 022777fa0badf3f33e867886d4731b5b |
|
BLAKE2b-256 | 56374e373372de7f809c1e4018da01e4c4d888dc5101655b5f2f8dd90a957296 |
File details
Details for the file pnu_basename-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: pnu_basename-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2019df68be97ba363ca5abd482036c60236a81381e288303c82aee46fef895b |
|
MD5 | e3fc7b718993fc3b8deae2f6593e70fd |
|
BLAKE2b-256 | 260ad55fc10edd31fd71fe2e5d6bbe81b6b2b7914f08105f62474b6bdb63a4fa |