"Fossies" - the Fresh Open Source Software Archive 
Member "afio-2.5.2/script3/pgp_write" (30 Nov 2018, 930 Bytes) of package /linux/misc/afio-2.5.2.tgz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 #!/bin/sh
2 #
3 # This example shows how to configure afio to write pgp encrypted archives.
4 #
5 # Setting the PGPPASS environment variable is unsafe.
6 #
7 # If you are using bash, you can use the input redirection by opening a second
8 # input stream linked to a file containing your pass phrase. Be careful about
9 # that file's permissions!
10 #
11 # working with any shell, but unsafe:
12 #
13 #export PGPPASS="your pass phrase"
14 #find * | afio -ov -Z -U -P "pgp" -Q "-fe" -Q "user_id_for_encryption" -Q "y" archive_file
15 #
16 # better, only working with bash(?):
17 #
18 export PGPPASSFD=3
19 find * | afio -ov -Z -U -P "pgp" -Q "-fe" -Q "user_id_for_encryption" -3 3 archive_file 3<passphrasefile
20
21 #WARNING: I (Koen Holtman) do not have pgp so I have not tested the above.
22 #If pgp has a property of being able to produce different-length output
23 #files when used twice on the same input, as gpg has, then the above script
24 #will sometimes cause errors in the backup.