Skip to content

GreenRaccoon23/rmext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rmext

Install

go get github.com/GreenRaccoon23/rmext

Clone

git clone https://github.com/GreenRaccoon23/rmext.git

Description

This is a simple command-line tool to print a filename without its extension. It's meant to be used in the same way basename, dirname, and realpath are used on Linux.

Examples:

[chuck@norris ~]$ base="$(rmext /some/path/file.txt)";
[chuck@norris ~]$ echo $base;
/some/path/file
[chuck@norris ~]$ pureBase="$(rmext -b /some/path/file.txt)";
[chuck@norris ~]$ echo $pureBase;
file

This program relies on the system's list of known mimetypes.
On Linux, the file /etc/mime.types usually stores these.
On Windows, the registry [mess] stores them.
In rare cases, the system may not have a mime entry for an uncommon file type, and this program will not remove the extension associated with that file type. An example is '.go' files; Linux distributions usually do not include a mime type for '.go' files by default (yet).

About

Simple command-line tool to print a filename without its extension. Supplements `basename`, `dirname`, and `realpath` on Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages