trying to execute gpg in a csh script

when I run this command on the command line
/usr/local/bin/gpg --always-trust -o /pw/data/EC_qual/gentran/vanout/backup/IBMC.0504135259.enc -se -r ecgpdd -u PaulFGreene --passphrase XXXXXXX  --armor /pw/data/EC_qual/gentran/vanout/backup/IBMC.0504135259

the file's encrypted and I get warning message but no prompts which is what I need BUT

when I run this script on the command line

call_gpgencrypt.csh /pw/data/EC_qual/gentran/vanout/backup/IBMC.0504135259 /pw/data/EC_qual/gentran/vanout/backup/IBMC.0504135259.enc

if ($#argv != 2) then
 echo 'two arguments not passed <tempfile> <logfile>'
 exit 1
endif
set ftpdate = `date +%m%d%H%M%S`
set tempfile = $argv[1]
set logfile = $argv[2]
/usr/local/bin/gpg --always-trust -o $logfile -se -r ecgpdd -u PaulFGreene --passphrase xxxxxx  --armor $tempfile
#

 I get
gpg: skipped "PaulFGreene": bad passphrase
gpg: [stdin]: sign+encrypt failed: bad passphrase
what's wrong
pf_greene724Asked:
Who is Participating?
 
ahoffmannCommented:
does your passphrase contain  something else than [a-zA-Z0-9.,] then you need to escape the characters or quote the string
you also may try using   --passphrase-fd 0
0
 
pf_greene724Author Commented:
yws I have a # I'll try quotes
0
 
pf_greene724Author Commented:
that worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.