I want to decrypt files with gpg (GnuPG) 2.2.27 and password without the --output option, so that the output file is just without the .gpg ending. This works, if I omit the ( --decrypt) command, like this:
gpg: WARNING: no command supplied. Trying to guess what you mean ...
How can I decrypt without this warning, without adding an --output option and a path for the decrypted path?
I just want the decrypted file without the .gpg ending and not as stdout.
you have to use -d or --decrypt to tell gpg that you want to decrypt a file.
Why is it important to you to decrypt a file without the --output option? If you’re using this option you don’t have to specify a path. You can just write --output myfile.txt so you get the file without the ending .gpg and it will be created where the gpg command is executed.
OK, it is not possible I guess.
It’s working this way (without -d) I just wanted to make it cleaner code (without warning).
If I use the file name (with -o), then I would need to extract it first and could not use just a simple bash loop, that’s why. Would blow up the code.
Ok then thank!
Ok, if I add the --quiet option (-q), the warning is omitted, but the --decryption command here is still missing.
In my case (in the loop) this warning is not showing up anyway. I only see it, if I decrypt a single file.
But I will add the --quiet option, to be sure
So I assume: it’s not possible to decrypt as default to a file name just without the .gpg, only if I omit the --decrypt command.
Yes. With --decrypt you’ll have to give the desired filename after --output. Same as if you use redirection with “>”.
I’m not sure if it is a good idea to leave off the --decrypt in your case, as the fallback to decryption could possibly be removed in the future. Though I don’t think it will. But I wouldn’t consider it a stable interface anyway…