multiple files for version below 1.2.5

DBSMITH at OhioHealth.com DBSMITH at OhioHealth.com
Tue Apr 19 19:00:21 CEST 2005


Never mind I got it to work.
Since I need two unique decrypted file names I said:

x=0
count=`ls -la /data/files|wc -l`
if count -gt 1
then
      until x -eq count
      do
            for i in $/data/files
            do
                  encryption with my output file with a suffix of .$x
                  sleep 1
                  let  x+=1
            done
      done
else
      encrypt one file
fi


Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145



                                                                           
             DBSMITH at OhioHealt                                             
             h.com                                                         
             Sent by:                                                   To 
             gnupg-users-bounc         "Stewart V. Wright"                 
             es at gnupg.org              <swright at physics.adelaide.edu.au>   
                                                                        cc 
                                       gnupg-users at gnupg.org,              
             04/19/2005 12:31          gnupg-users-bounces at gnupg.org       
             PM                                                    Subject 
                                       Re: multiple files for version      
                                       below 1.2.5                         
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Stewart,
I am trying to decrypt more than one file if ls -la |wc -l /dir is -gt one.
Thanks for the tips, but my $var variable actually contains both file names
like so:

      for i in $var
      do
            echo $i
      done

/psofthr/hr88prd/intf/aflac/inbound/filename1
/psofthr/hr88prd/intf/aflac/inbound/filename2

so I am ok there, but when I placed the echo infront of the gpg string I
found that the same PID is being used.

gpg --passphrase-fd 0 --decrypt --output
/psofthr/hr88prd/intf/aflac/inbound/OHIO_HEALTH.gpg.319548
/psofthr/hr88prd/intf/aflac/inbound/OHIO_HEALTH_20050324.TXT.pgp
gpg --passphrase-fd 0 --decrypt --output
/psofthr/hr88prd/intf/aflac/inbound/OHIO_HEALTH.gpg.319548
/psofthr/hr88prd/intf/aflac/inbound/OHIO_HEALTH_20050408.TXT.pgp

Finally, in the decryption process you need two uniq filenames b/c there
are two decryption processes which is why I used $$.

      gpg $p $de $outp $dec.$$ $i

Anyone more ideas?  thank you,

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams





             "Stewart V.
             Wright"
             <swright at physics.                                          To
             adelaide.edu.au>          gnupg-users at gnupg.org
             Sent by:                                                   cc
             gnupg-users-bounc
             es at gnupg.org                                          Subject
                                       Re: multiple files for version
                                       below 1.2.5
             04/19/2005 11:47
             AM








G'day DBSMITH,

* DBSMITH at OhioHealth.com <DBSMITH at OhioHealth.com> [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.

Questions:
  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
    ${var}stuff
  However that is an aside.


Cheers,

S.

(See attached file: att4gqr9.dat)
_______________________________________________
Gnupg-users mailing list
Gnupg-users at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
(See attached file: att4gqr9.dat)
_______________________________________________
Gnupg-users mailing list
Gnupg-users at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: att4gqr9.dat
Type: application/octet-stream
Size: 282 bytes
Desc: not available
Url : /pipermail/attachments/20050419/7fdb3003/att4gqr9.obj


More information about the Gnupg-users mailing list