Bitcoin Forum

Other => Off-topic => Topic started by: salty on September 08, 2012, 09:00:47 PM



Title: GPG shell help with stdin
Post by: salty on September 08, 2012, 09:00:47 PM
Can anyone explain to me how to GPG decrypt my clipboard buffer instead of a file?

Here's what I've tried and it doesn't work..

type 'gpg' or 'gpg -d' in a shell

paste a pgp message (apple-V) into the shell

??? nothing happens until I ctrl-c to close gpg down.

I guess I don't know what to do while gpg is running, and all the help files i can find seem to relate to operations on files



Title: Re: GPG shell help with stdin
Post by: scintill on September 08, 2012, 09:06:35 PM
Try ctrl-D after you paste, that signals "end of file" when reading from stdin.  GPG should then output the decrypted content.


Title: Re: GPG shell help with stdin
Post by: salty on September 08, 2012, 09:21:17 PM
nicely done :) thanks. Do you know if the 'ctrl-d' is a standard unix end of file signal or specific to gpg?


Title: Re: GPG shell help with stdin
Post by: gweedo on September 08, 2012, 09:23:05 PM
I use usually do
Code:
echo "SIGN THIS" | gpg -a -s


Title: Re: GPG shell help with stdin
Post by: salty on September 08, 2012, 09:29:12 PM
I use usually do
Code:
echo "SIGN THIS" | gpg -a -s

Cheers for the info, I got where I wanted with 'ctrl-d' though, pipes (is | a pipe?) are going to be for another day I think ;)


Title: Re: GPG shell help with stdin
Post by: scintill on September 08, 2012, 09:36:21 PM
nicely done :) thanks. Do you know if the 'ctrl-d' is a standard unix end of file signal or specific to gpg?

Standard Unix when reading from stdin. Good question, forgot to mention that.

You might have to Ctrl-D a second time to fully terminate the reading -- the first one will just let the program read what you've typed so far, if it hasn't read it yet.  Anyway, glad it helped!