Quantcast
Channel: Gubatron.com
Viewing all articles
Browse latest Browse all 174

[bash scripting] How to get a file’s name without its extension(s).

$
0
0

Say you have an encrypted file file.foo.gpg and you want to make a shorthand command to decrypt that file, you’ll want the resulting file to be named file.foo (without the .gpg), or say you want the name, with no extension?), you can use bash’s magic variable voodo for that.

Screen Shot 2014-09-06 at 4.29.38 PM

A simple version of that script would look something like this:
Screen Shot 2014-09-06 at 4.34.26 PM


Viewing all articles
Browse latest Browse all 174

Trending Articles