LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-11-2009, 05:18 PM   #1
plebetan
Member
 
Registered: Jan 2009
Posts: 31

Rep: Reputation: 15
gpg and stdout


I've been using gpg lately and I've noticed that "gpg --decrypt" always defaults to stdout if no output file is specified. So, I always do "gpg --decrypt ./foo.gpg > ./foo", and pipe it around and stuff, which I like.

But, when I encrypt files, it always defaults to creating a file called "file.gpg". I want to be able to encrypt a file with "gpg --encrypt file" and have the output come out on stdout. is there any way to do that?
 
Old 07-12-2009, 04:40 AM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
the secret is to pipe the plaintext into gpg.


echo "Secret Message" | gpg --encrypt -r user@example.com

to save your self from using a reset command after that, you might insert -a between gpg and --encrypt

For the win:

echo "Secret Message" | gpg -a --encrypt -r user@example.com
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 11:06 AM
How to redirect standard stdout to multi stdout ( Bash )? john.daker Programming 4 11-04-2008 12:20 AM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 03:36 AM
what is stdout stefaandk Linux - Newbie 1 09-06-2005 08:20 PM
stdout with tk? sk8guitar Programming 1 07-30-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration