|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Accessing email text sent from Sendmail in a Shell script
Hi
I'm new to shell scripting, and can't find the answer to this in any documentation. I have set up Sendmail to redirect mail onto a shell script. My question is; how do I then access the email text to process it within the script? Is there an environment variable for accessing passed in text, I'm assuming it would be treated the same as text entered via stdin, would something like $* or $@ work (I know these are meant for arguements)? or is there a way to load in any passed on info into a variable something like variable=stdin Thanks in advance for any replies David |
|
#2
|
|||
|
|||
|
"man aliases" should tell you how to send mail into a program.
In a ksh or bash script you can read from stdin with: read line which reads one line into the variable $line. You would probably use a loop something like: while read line ; do echo line = $line done |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Accessing email text sent from Sendmail in a Shell script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|