Register
It is currently Tue Sep 30, 2014 1:52 pm

Why ? gpg: cannot open `/dev/tty' [SOLVED]


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Sat Jan 28, 2012 9:05 am   

Joined: Sat Jan 28, 2012 8:27 am
Posts: 2
Hello to everyone,
nice to meet you.

Well, my first problem.
If I write this into terminal
gpg-d name_file > name_file.out
gpg decrypt the name_file

but this script bash:
#!/bin/bash
gpg-d name_file > name_file.out
don't work

If I write this:
#!/bin/bash
gpg-d name_file &> out.txt

it returns this text:
gpg: cannot open `/dev/tty': Nessun device o indirizzo corrispondente

This isn't what I expected. :)
In addition to solving the problem, I'd like to understand it

Thank you

Ciao Andrea

p.s. - I ask pardon for my bad English


Last edited by algedi on Tue Jan 31, 2012 1:02 pm, edited 1 time in total.

Top
 Profile  
 PostPosted: Mon Jan 30, 2012 6:18 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
Hi,

This information is in the man page, check it out.
I suspect you'll need to use --batch to stop it asking interactive questions and probably one of the --passphrase* options too.

DW


Top
 Profile  
 PostPosted: Tue Jan 31, 2012 1:16 pm   

Joined: Sat Jan 28, 2012 8:27 am
Posts: 2
Hi, DarthWavy
You hit the problem.
echo "$PASSPHRASE" | gpg --batch --passphrase-fd 0 --output "$FILE_OUT" --decrypt "$FILE_IN"
without --passphrase-fd and echo ... | the command ask passphrase with simply GUI
thank you

DarthWavy wrote:
Hi,

This information is in the man page, check it out.
I suspect you'll need to use --batch to stop it asking interactive questions and probably one of the --passphrase* options too.

DW


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP