?
Solved

How to write a script for PGP encryption in unix

Posted on 2013-06-26
1
Medium Priority
?
864 Views
Last Modified: 2013-06-27
Hi All,
 Can someone help me to write a script in unix which has to pick a file from a directory,encrypt the file using PGP commands and place it in the destination directory?

I am new to scripting to unix and PGP

Appreciate your help,

Thanks and Regards,
0
Comment
Question by:ra100020
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
fridom earned 1500 total points
ID: 39280926
Well it depends on what Shell you like to use. How do you want to add the directories?

int the end you need something like

#!/usr/bin/zsh

source_directory="/usr/local/tmp"
target_directory="/tmp"
source_file="$1"

gpg --output "$target_directory/$source_file.gpg" --encrypt -r recipient $source_file  

Open in new window


It's up to you to improve on the user interface. Printing help etc. But this should give you an idea.

Regards
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month10 days, left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question