HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: STDN of a Mail message
Operating System - HP-UX
1825782
Members
2134
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2001 02:28 PM
01-10-2001 02:28 PM
I have written a script that greps for certain strings on /var/mail/user and then takes neccessary action. I can run this script in cron every 15 minutes. However, I want to run the script only when a new message comes in..I can add the following line to the users .forward file
| /usr/contrib/bin/notify
this sends the message as stdn to the script notify,
but how do I modify the notify script te READ the stdn? an example would be greatly appreciated. thanks
| /usr/contrib/bin/notify
this sends the message as stdn to the script notify,
but how do I modify the notify script te READ the stdn? an example would be greatly appreciated. thanks
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2001 03:05 PM
01-10-2001 03:05 PM
Solution
depends if you need the whole message to operate on or if you can handle the message one line at a time.
If you need the whole message, write it to a temporary file, do your operations, then remove it:
awk '{print $0;}' > tmpfile
stuff
rm tempfile
If you can do things one line at a time you can write awk script:
awk '
pattern { do this;}
' etc. or put a read statement in a while loop:
while read this
do
case $this in
stuff) do this;;
easc
done
If you need the whole message, write it to a temporary file, do your operations, then remove it:
awk '{print $0;}' > tmpfile
stuff
rm tempfile
If you can do things one line at a time you can write awk script:
awk '
pattern { do this;}
' etc. or put a read statement in a while loop:
while read this
do
case $this in
stuff) do this;;
easc
done
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP