- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: another scripting question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО08-21-2003 10:36 AM
тАО08-21-2003 10:36 AM
Anybody with any ideas?
I don't need specific code, just some help with a way to approach the problem.
Thanks,
-Bryan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2003 10:37 AM
тАО08-21-2003 10:37 AM
Re: another scripting question
-Bryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2003 10:44 AM
тАО08-21-2003 10:44 AM
Solution#!/usr/bin/sh
INFILE=myfile
tail -f ${INFILE} | while read X
do
echo "${X}"
done
Create a file "myfile" and start the above script. Now do something like echo "XXX" >> myfile and you will magically see the new line of onput appear. Your processing goes where the current echo "${X}" is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2003 10:46 AM
тАО08-21-2003 10:46 AM
Re: another scripting question
Compare that to the copy you made 5 minutes ago and then grep for the line you are looking for and react if you find it.
You can put this all inside a loop with a sleep.
Loop around Something like:
sleep 300
cp logfile ms.newlogfile
diff ms.oldlogfile ms.newlogfile > ms.useme
grep "yourstring" ms.useme > ms.useme2
if [ -s ms.useme2 ]
do your other stuff
fi
Then close the loop
The sleep 300 is your 5 minute delay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2003 10:52 AM
тАО08-21-2003 10:52 AM
Re: another scripting question
So simple, yet so far away! Thanks for clearing up the water for me.
-Bryan