Sponsored Content
Top Forums Shell Programming and Scripting Invoke a shell script in case mail with a specific subject is received Post 303000411 by jgt on Tuesday 11th of July 2017 09:22:18 PM
Old 07-11-2017
I might be inclined to write it as:
Code:
IFS=":"
while read keyword data
do
if ["$keyword" = "Subject" ]
then
     if [ "$data" = "this is it" ]
      then
      do your stuff
      fi
fi
done

I would also retain the original email address in the alias file
Code:
my_email        my_email,|/usr/bin/myscript

Also you may have to run 'newaliases' to create an new hash table
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

2. Shell Programming and Scripting

how to invoke shell script

hi everybody, i learning unix now only.Can u pls guide me in invoking a shell script.Actually i need to know how to write the command for invoking the shell script.Suppose the shell file name is count , then how i will write the command. thanks (1 Reply)
Discussion started by: gopa_mani
1 Replies

3. Shell Programming and Scripting

Bourne: How to invoke an alias from within a shell script

Bourne: How to invoke an alias from within a shell script If I type in the alias in the command line, it runs If I insert that same alias into my shell script and run the shell script, the alias is not invoked. Help please. (2 Replies)
Discussion started by: techshots
2 Replies

4. UNIX for Dummies Questions & Answers

need to invoke a shell script from xml file.

hi all, forgive me if this question is not relevant to this section. i have a shell file that will automatically deploy the files that are necessary and will compile them. i need to automate this management process through cruise control, for this i need to know whether it is possible for me to... (2 Replies)
Discussion started by: sais
2 Replies

5. Shell Programming and Scripting

Shell script to invoke db startup/shutdown

Hi all, I have a shell script which does db shutdown ..the script snippet which does this is as follows: function call_sql_plus { ${SQLPLUS:-sqlplus} -s /nolog <<EOF EXIT; EOF if then echo "Error occurred while calling sqlplus " ... (3 Replies)
Discussion started by: KrishnaSaran
3 Replies

6. Shell Programming and Scripting

How can i invoke SU command in shell script

Hi All , i am trying to switch user (from unix1 to unix 2 ) The user will give me the input and also the password . also how can i login into with the password . itried several attempts . no luck Can any one help on this !!! (4 Replies)
Discussion started by: raghav1982
4 Replies

7. Shell Programming and Scripting

Shell script to invoke options automatically

i have a script which has 2 options. a b And a has 6 sub options. i want to write a script which will call the parent script and give options automatically. examle: linasplg11:/opt/ss/kk/01.00/bin # startup.sh /opt/ss/rdm/01.00 Please select the component to... (2 Replies)
Discussion started by: Aditya.Gurgaon
2 Replies

8. UNIX for Dummies Questions & Answers

Invoke a shell script on new email in inbox

Hello all, Is there a way I can invoke a shell script when ever a new mail is delivered to my account in solaris? Something like .forward file, instead of forwarding it to another email id, I want the email to be passed onto some shell script. Basically I want to extract the envelop... (3 Replies)
Discussion started by: atukuri
3 Replies

9. Shell Programming and Scripting

Problem while Invoke Shell Script function from Java Program

Hi, I have create a Shell Script, with one function. I want to call the script file in Java Program. It working fine. but the problem is the function in the Shell Script is not executed. Please suggest me, Regards, Nanthagopal A (2 Replies)
Discussion started by: nanthagopal
2 Replies

10. Shell Programming and Scripting

How to check email with attachment received or not from UNIX shell script?

Hello Guys, Here is the requirement!! I want to check the mail with attachment received or not through unix scripting. And send an notification email when mail with attachment already received. Any thoughts on this is much appreciated!! Regards, Harry (0 Replies)
Discussion started by: dharry2017
0 Replies
newaliases(1M)						  System Administration Commands					    newaliases(1M)

NAME
newaliases - rebuild the data base for the mail aliases file SYNOPSIS
newaliases DESCRIPTION
newaliases rebuilds the random access data base for the mail aliases file /etc/mail/aliases. newaliases accepts all the flags that sendmail(1M) accepts. However, most of these flags have no effect, except for the -C option and three of the Processing Options that can be set from a configuration file with the -o option: -C /path/to/alt/config/file Use alternate configuration file. -oAfile Specify possible alias files. -oLn Set the default log level to n. Defaults to 9. -on Validate the RHS of aliases when rebuilding the aliases(4) database. newaliases runs in verbose mode (-v option) automatically. EXAMPLES
Example 1 Running the newaliases Command The following command runs newaliases on an alias file different from the /etc/mail/aliases default in sendmail(1M): example% newaliases -oA/path/to/alternate/alias/file EXIT STATUS
newaliases returns an exit status describing what it did. The codes are defined in /usr/include/sysexits.h. EX_OK Successful completion on all addresses. EX_NOUSER User name not recognized. EX_UNAVAILABLE Catchall. Necessary resources were not available. EX_SYNTAX Syntax error in address. EX_SOFTWARE Internal software error, including bad arguments. EX_OSERR Temporary operating system error, such as "cannot fork". EX_NOHOST Host name not recognized. EX_TEMPFAIL Message could not be sent immediately, but was queued. FILES
/etc/aliases Symbolic link to /etc/mail/aliases /etc/mail/aliases.pag /etc/mail/aliases.dir ndbm files maintained by newaliases /etc/mail/aliases.db Berkeley DataBase file maintained by newaliases ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsndmu | +-----------------------------+-----------------------------+ SEE ALSO
sendmail(1M), aliases(4), attributes(5) SunOS 5.11 14 Sep 2001 newaliases(1M)
All times are GMT -4. The time now is 12:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy