Option for basename to strip prefix in stead of suffix
Bug #173211 reported by
Pander
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: coreutils
The tool basename should have an option to strip prefix in stead of suffix.
Now it can only cut off characters at the end of a string, but for some operations it is desirable to cut chararcters from the beginning of the string.
Implementing this request will allow users to have more control over using derived versions of filenames.
Changed in coreutils: | |
importance: | Undecided → Wishlist |
To post a comment you must log in.
Thank you for opening this bug and helping making Ubuntu better. Before I propose this upstream, I would like to know more about what you would like to have -- is it just a fixed prefix (pretty much like the suffix currently supported)?
For example (and supposing this new option is to be triggered by the '-p' or '--prefix' parameter):
basename --prefix atest /this/is/ a/sample/ atest-data. filename
would return '-data.filename', while
basename --prefix atest /this/is/ a/sample/ atest-data. filename .filename
would return '-data'.
Is this a correct interpretation?
Thanks.