multiple files for version below 1.2.5

Stewart V. Wright swright at
Tue Apr 19 17:47:23 CEST 2005


* DBSMITH at <DBSMITH at> [050419 10:37]:
> I am trying to decrypt 2 files on a UNIX machine with:
> var=/data/files
> file=file_that_has_my_passphrase
> p='- -passphrase-fd-0'
> outp='- -output'
> de='- -decrypt'
> dec=file
> for i in $var
> do
>       cat $file |gpg $p $de $outp $dec.$$ $i
>       sleep 1
> done
> and the error I get is
> Sorry no terminal at all requested - cat get input.

Hint 1: Use echo to help you debug - i.e.  
    echo cat $file
    echo gpg ......
  That way you can see what your script is _trying_ to do, not what
  you want it to do.

  What are you trying to do?  Decrypt all the files in the directory
  "/data/files" ?  This script won't do that.  You are passing
  "/data/files" to GnuPG, not a list of the files IN that directory.
  (You will see this when you use the echo hint above.)

  If you want all of the files inside /data/files, set
  var=/data/files/* and that should work.

Hint 2: I find it useful (others will disagree) to put brackets around
  my variables to let the shell be sure what I want it to do...
  So the line:
    for i in $var
  would become
    for i in ${var}
  Then there is no confusion when you want to do something like
  However that is an aside.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 274 bytes
Desc: not available
Url : /pipermail/attachments/20050419/31ee14f8/attachment.pgp

More information about the Gnupg-users mailing list