GPG encryption/decryption commands are not working in a shell script Unicorn Meta Zoo #1: Why...

Map material from china not allowed to leave the country

What is the ongoing value of the Kanban board to the developers as opposed to management

Could moose/elk survive in the Amazon forest?

Economise space with floats

Multiple fireplaces in an apartment building?

How to count in linear time worst-case?

Seek and ye shall find

What is /etc/mtab in Linux?

Why does the Cisco show run command not show the full version, while the show version command does?

How to translate "red flag" into Spanish?

Is this homebrew racial feat, Stonehide, balanced?

How to use @AuraEnabled base class method in Lightning Component?

Check if a string is entirely made of the same substring

My bank got bought out, am I now going to have to start filing tax returns in a different state?

How to keep bees out of canned beverages?

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

Visa-free travel to the US using refugee travel document from Spain?

Are all CP/M-80 implementations binary compatible?

"Rubric" as meaning "signature" or "personal mark" -- is this accepted usage?

What is the best way to deal with NPC-NPC combat?

How to avoid introduction cliches

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Can you stand up from being prone using Skirmisher outside of your turn?



GPG encryption/decryption commands are not working in a shell script



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraWhat are commands to find shell keywords, built in functions and user defined functions?Is there a way to revoke a GPG encryption key?Set up gpg to decrypt own local files without supplying passphrasepgp decryption of file encrypted from named pipe as input does not decrypt to execution directoryAccess to line arguments in shell scriptDuplicity encryptiongpg does not ask for passphrase on one encrypted fileDo I have to decrypt a signed and encypted file twice to get the actual data file?ecryptfs - Encrypting identical files with the same key leads to different resultsFind command script, gpg decryption, and proper shell path





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















As part of a shell script, I need to encrypt and decrypt files. From the command line my commands are working and files are getting encrypted/decrypted, but the same commands are not working from a shell script.



Used commands are:



echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA --encrypt filename.sh
echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA filename.sh.gpg









share|improve this question









New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • unix.stackexchange.com/questions/60213/… this question suggests adding --batch

    – David K
    3 hours ago


















0















As part of a shell script, I need to encrypt and decrypt files. From the command line my commands are working and files are getting encrypted/decrypted, but the same commands are not working from a shell script.



Used commands are:



echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA --encrypt filename.sh
echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA filename.sh.gpg









share|improve this question









New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • unix.stackexchange.com/questions/60213/… this question suggests adding --batch

    – David K
    3 hours ago














0












0








0








As part of a shell script, I need to encrypt and decrypt files. From the command line my commands are working and files are getting encrypted/decrypted, but the same commands are not working from a shell script.



Used commands are:



echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA --encrypt filename.sh
echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA filename.sh.gpg









share|improve this question









New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












As part of a shell script, I need to encrypt and decrypt files. From the command line my commands are working and files are getting encrypted/decrypted, but the same commands are not working from a shell script.



Used commands are:



echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA --encrypt filename.sh
echo "PASSPHRASE" | gpg --passphrase-fd 0 --always-trust -r INFRA filename.sh.gpg






linux bash shell encryption






share|improve this question









New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 5 hours ago









Worthwelle

2,85931325




2,85931325






New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 13 hours ago









Naveen RohithNaveen Rohith

1




1




New contributor




Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Naveen Rohith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • unix.stackexchange.com/questions/60213/… this question suggests adding --batch

    – David K
    3 hours ago



















  • unix.stackexchange.com/questions/60213/… this question suggests adding --batch

    – David K
    3 hours ago

















unix.stackexchange.com/questions/60213/… this question suggests adding --batch

– David K
3 hours ago





unix.stackexchange.com/questions/60213/… this question suggests adding --batch

– David K
3 hours ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Naveen Rohith is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429046%2fgpg-encryption-decryption-commands-are-not-working-in-a-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Naveen Rohith is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Naveen Rohith is a new contributor. Be nice, and check out our Code of Conduct.













Naveen Rohith is a new contributor. Be nice, and check out our Code of Conduct.












Naveen Rohith is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429046%2fgpg-encryption-decryption-commands-are-not-working-in-a-shell-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...