![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sending mail | parmeet | UNIX for Dummies Questions & Answers | 11 | 05-13-2009 04:37 AM |
| hp ux not sending mail | kkhan | HP-UX | 3 | 01-31-2008 11:27 PM |
| Mail sending | panknil | Shell Programming and Scripting | 15 | 09-19-2007 02:24 AM |
| Sending mail thru HP-UX | medisetti | HP-UX | 1 | 02-22-2007 07:08 PM |
| sending a mail to a mail client | solaris73 | UNIX for Dummies Questions & Answers | 5 | 11-18-2002 01:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help with GPG Scripting and sending mail when done!!!
I am very new to linux so please explain things to me like I was not from this world. I never wanted to learn linux, but since the other IT person is gone, I was the only one left. So now I have been messing around with it alot, and I really like it. Bought a few books, and CBT's to get use to it, and I absolutely love it, though my games don't work, I can live without them for now.
Anyways, I am making a script to decrypt a file and then send an email when done. The thing is I want to keep this as close to automatically as possible. So the next person won't need to fuss about the long process of our loads. So my first problem is displaying the files with certain credentials, then moving all previous files to a backup folder. Our clients sometimes sends us two files, but the latest one is the one we need to process. But I can not even get this program to display all the files. Then after displaying it move the old files to backup and only have the newest file. I have this so far: #!bin/bash # Check directory for all rabadd*.gpg if [ -e /home/eacsci1/rabadd*.gpg ]; then echo "rabadd encrypted file(s) exist" # Locate and display files with name rabadd and ext .gpg. Then clear when done. find -maxdepth 1 -name rabadd*.gpg > rabadd.txt ; cat rabadd.txt ; rm rabadd.txt. # In case the encrypted file does not exist, let user know. else echo "rabadd encrypted file(s) not found!" fi |
|
||||
|
here is a start: Code:
#!bin/bash
# Check directory for all rabadd*.gpg
filefound=$(ls /home/eacsci1/rabadd*.gpg > 2>&1 > /dev/null; echo $?)
if [ $filefound -eq 0 ]] ; then
echo "rabadd encrypted file(s) exist"
# Locate and display files with name rabadd and ext .gpg. Then clear when done.
find -maxdepth 1 -name rabadd*.gpg -exec ls -l {} \;
# In case the encrypted file does not exist, let user know.
else
echo "rabadd encrypted file(s) not found!"
fi
|
|
||||
|
Ok I added the script you mention besides Code:
[ $filefound -eq 0 ]] I think this should only have one bracket, right? Anyways it still produces an error message that I can not interpret Code:
./prep_down.sh: command substitution: line 14: syntax error near unexpected token `2' ./prep_down.sh: command substitution: line 14: `ls /home/eacsci1/rabadd*.gpg > 2>&1 > /dev/null; echo $?' ./prep_down.sh: line 16: [: -eq: unary operator expected rabadd encrypted file(s) not found! I will change it up and get some understanding of this part, until someone can point out the issue here. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|