Sponsored Content
Top Forums Shell Programming and Scripting need help in finding a string and to send an email using shell script Post 302167845 by ranga27 on Friday 15th of February 2008 03:48:06 PM
Old 02-15-2008
need help in finding a string and to send an email using shell script

Hi All

i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person

This is basically to find the encrypetd keys which are loaded in the unix server

Below are sample keys not the true values:

pub 5858D/58585255EF 2007-10-02 unicorn01516008 <uniccrn@fund.com>
sub 452659g/97974545df 2007-10-02 [expires: 2008-06-22]


once i run the shell script it will execute the command gpg --list-keys and then search for the string and the output should be like this ::

unicorn01516008 <uniccrn@fund.com> Expires on 2008-06-22 and this has to be emailed to some xxxx@xxxx.com

can you please help me in giving me some sample code !!!

Thanks a lot for your help!!!
 

10 More Discussions You Might Find Interesting

1. Solaris

Shell script to send email alert for core dump

Friends, I am in search for a shell script that is capable of running as a cronjob and have to send out an email when ever there is a CORE DUMP. Please post the hints to achieve my goal. Thanks in advance. (1 Reply)
Discussion started by: rtatineni
1 Replies

2. Shell Programming and Scripting

How to write a shell script to send an email to an id

Hi all, I want to know how to send an email using shell script ..... I tried a command call mail but it did not work.. Please any one reply.. With example if you know thanks.. Madhu (4 Replies)
Discussion started by: madhumathikv
4 Replies

3. Shell Programming and Scripting

make un shell script to send email

Hi, Someone Knows how to obtein a chain from a unix file, but not all the line, for exemple, for this file ,obtein only 902111111 and to keep the value, this value will be used to make a mailx. NF=ALL, SUBJ= FROM: SN=CD, SE=TOPCALL, NA=, N=902111111, N=TCLFI TO: SE=FAX, NA=, C1=... (0 Replies)
Discussion started by: peybol
0 Replies

4. Shell Programming and Scripting

How to send email once a day at certain time in unix shell script

hi, i have to send an email once a day at ceratin time say 22. i have tried with date commad, but not working.:( HOUROFTHEDAY=`date +'%H'` if ; then mailx -s "Info" emailid@org.com < $ProcessStatisticsFile fi Please help me... (5 Replies)
Discussion started by: sreelu
5 Replies

5. Shell Programming and Scripting

How to send email through shell script

Hi All, I am new to the unix , i have to deliver one script very urgently I have to write a shell script where i have i want to send email to specific email id in this script i want FROM to be parameterized and stored in a variable TO to be parameterized and stored in a variable... (3 Replies)
Discussion started by: nileshbhawsar
3 Replies

6. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

7. Shell Programming and Scripting

Shell script to send an email from the txt file

Hi Friends, Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file. text file contains the no. of records like: giridhar 224285 847333 giridhar276@gmail.com ramana 84849 33884 venkata.ramana@gmail.com... (6 Replies)
Discussion started by: giridhar276
6 Replies

8. Shell Programming and Scripting

Help with shell script to send email once

Hi Guys, I have this script which will monitor oracle db process if up or down.And I want it to send email if it's down and the time it's back to online. However my script just keep on sending "Email Up" if the db is up or "Email Down" if the db is down.Is there any way to trap it so that it... (5 Replies)
Discussion started by: d3xt3r
5 Replies

9. Shell Programming and Scripting

how to send html email from shell script

This is my below script which is working fine as it send only plain text email. So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression `(echo "100*$TEST2/$TEST1" | bc -l)` as `RED` in an email and that can be... (3 Replies)
Discussion started by: raihan26
3 Replies

10. Shell Programming and Scripting

Need command to capture word from shell script and send email

Hello Experts, Greeting to all of you. I have a requirement, that we have a shell script status.sh that check the status of server and server status shows as status.sh Enterprise Server - Running Admin Server - Shutdown Requirement is like whenever the output shows shutdown it should... (2 Replies)
Discussion started by: aks_1902
2 Replies
CAFF(1) 						User Contributed Perl Documentation						   CAFF(1)

NAME
caff -- CA - Fire and Forget SYNOPSIS
caff [-eERS] [-m yes|ask-yes|ask-no|no] [-u yourkeyid] keyid [keyid ..] DESCRIPTION
CA Fire and Forget is a script that helps you in keysigning. It takes a list of keyids on the command line, fetches them from a keyserver and calls GnuPG so that you can sign it. It then mails each key to all its email addresses - only including the one UID that we send to in each mail, pruned from all but self sigs and sigs done by you. The mailed key is encrypted with itself as a means to verify that key belongs to the recipient. OPTIONS
-e, --export-old Export old signatures. Default is to ask the user for each old signature. -E, --no-export-old Do not export old signatures. Default is to ask the user for each old signature. -m, --mail yes|ask-yes|ask-no|no Whether to send mail after signing. Default is to ask, for each uid, with a default value of yes. -R, --no-download Do not retrieve the key to be signed from a keyserver. -S, --no-sign Do not sign the keys. -u yourkeyid, --local-user yourkeyid Select the key that is used for signing, in case you have more than one key. To sign with multiple keys at once, separate multiple keyids by comma. This option requires the key(s) to be defined through the keyid variable in the configuration file. --key-file file Import keys from file. Can be supplied more than once. --keys-from-gnupg file Try to import keys from your standard GnuPG keyrings. FILES
$HOME/.caffrc - configuration file $HOME/.caff/keys/yyyy-mm-dd/ - processed keys $HOME/.caff/gnupghome/ - caff's working dir for gpg $HOME/.caff/gnupghome/gpg.conf - gpg configuration useful options include use-agent, keyserver-options, default-cert-level, etc. CONFIGURATION FILE OPTIONS
The configuration file is a perl script that sets values in the hash %CONFIG. The file is generated when it does not exist. Example: $CONFIG{'owner'} = q{Peter Palfrader}; $CONFIG{'email'} = q{peter@palfrader.org}; $CONFIG{'keyid'} = [ qw{DE7AAF6E94C09C7F 62AF4031C82E0039} ]; Required basic settings owner [string] Your name. REQUIRED. email [string] Your email address, used in From: lines. REQUIRED. keyid [list of keyids] A list of your keys. This is used to determine which signatures to keep in the pruning step. If you select a key using -u it has to be in this list. REQUIRED. General settings caffhome [string] Base directory for the files caff stores. Default: $HOME/.caff/. GnuPG settings gpg [string] Path to the GnuPG binary. Default: gpg. gpg-sign [string] Path to the GnuPG binary which is used to sign keys. Default: what gpg is set to. gpg-delsig [string] Path to the GnuPG binary which is used to split off signatures. This was needed while the upstream GnuPG was not fixed. Default: what gpg is set to. secret-keyring [string] Path to your secret keyring. Default: $HOME/.gnupg/secring.gpg. also-encrypt-to [keyid, or list of keyids] Additional keyids to encrypt messages to. Default: none. gpg-sign-args [string] Additional commands to pass to gpg after the "sign" command. Default: none. Keyserver settings keyserver [string] Keyserver to download keys from. Default: pool.sks-keyservers.net. no-download [boolean] If true, then skip the step of fetching keys from the keyserver. Default: 0. key-files [list of files] A list of files containing keys to be imported. Signing settings no-sign [boolean] If true, then skip the signing step. Default: 0. ask-sign [boolean] If true, then pause before continuing to the signing step. This is useful for offline signing. Default: 0. export-sig-age [seconds] Don't export UIDs by default, on which your latest signature is older than this age. Default: 24*60*60 (i.e. one day). local-user [keyid, or list of keyids] Select the key that is used for signing, in case you have more than one key. With multiple keyids, sign with each key in turn. Mail settings mail [boolean] Whether to send mails. This is a quad-option, with which you can set the behaviour: yes always sends, no never sends; ask-yes and ask- no asks, for each uid, with according defaults for the question. Default: ask-yes. In any case, the messages are also written to $CONFIG{'caffhome'}/keys/ mail-template [string] Email template which is used as the body text for the email sent out instead of the default text if specified. The following perl variables can be used in the template: {owner} [string] Your name as specified in the owner setting. {key} [string] The keyid of the key you signed. {@uids} [array] The UIDs for which signatures are included in the mail. reply-to [string] Add a Reply-To: header to messages sent. Default: none. bcc [string] Address to send blind carbon copies to when sending mail. Default: none. mailer-send [array] Parameters to pass to Mail::Mailer. This could for example be $CONFIG{'mailer-send'} = [ 'smtp', Server => 'mail.server', Auth => ['user', 'pass'] ]; to use the perl SMTP client or $CONFIG{'mailer-send'} = [ 'sendmail', '-o8' ]; to pass arguments to the sendmail program. For more information run "perldoc Mail::Mailer". Setting this option is strongly discouraged. Fix your local MTA instead. Default: none. AUTHORS
Peter Palfrader <peter@palfrader.org> Christoph Berg <cb@df7cb.de> WEBSITE
http://pgp-tools.alioth.debian.org/ SEE ALSO
gpg(1), pgp-clean(1), /usr/share/doc/signing-party/caff/ perl v5.12.4 2011-11-01 CAFF(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy