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.
A simple version of that script would look something like this: