go get github.com/GreenRaccoon23/rmext
git clone https://github.com/GreenRaccoon23/rmext.git
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).