HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- writing one script
Operating System - HP-UX
1828014
Members
1893
Online
109973
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
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
05-08-2010 01:53 AM
05-08-2010 01:53 AM
writing one script
Hi All,
i need to basic script will be able to look at a log file periodically and report on any new lines that contain
either "error" or "warning". The search for this text is to be "case insensitive". This means that the script
needs to accept a line containing either "error", "Error", "ERROR" or the word error spelt in any other
combination of upper and lower case letters as being functionally equivalent.
with this Specific Requirements
The basic script, named "logmon" (for log monitor) will need to do the following:
be able to run in an environment that does not include a path. (i.e. the environment provided by
cron)
1
accept the name of a log le as the sole command line argument
search the speci ed log le for lines that have been added since the previous search. (It is up to you
how you implement this - there are several possible solutions to this problem.)
construct an e-mail reporting any lines that contain either "error" or \warning" in any combination
of upper and lower case letters (This is easier than some of the alternatives.)
send the e-mail to the address speci ed in the RECIPIENT shell variable which is de ned within the
script
generally follow good scripting practice as de ned in the lab notes and Scripting Notes booklet. (Note
that the examples in the lecture notes are not to be considered good examples of scripting standards
as implementation of some aspects of the standards was intentionally omitted to allow the code to
fit on a single lecture slide.)
Thanks a lot
i need to basic script will be able to look at a log file periodically and report on any new lines that contain
either "error" or "warning". The search for this text is to be "case insensitive". This means that the script
needs to accept a line containing either "error", "Error", "ERROR" or the word error spelt in any other
combination of upper and lower case letters as being functionally equivalent.
with this Specific Requirements
The basic script, named "logmon" (for log monitor) will need to do the following:
be able to run in an environment that does not include a path. (i.e. the environment provided by
cron)
1
accept the name of a log le as the sole command line argument
search the speci ed log le for lines that have been added since the previous search. (It is up to you
how you implement this - there are several possible solutions to this problem.)
construct an e-mail reporting any lines that contain either "error" or \warning" in any combination
of upper and lower case letters (This is easier than some of the alternatives.)
send the e-mail to the address speci ed in the RECIPIENT shell variable which is de ned within the
script
generally follow good scripting practice as de ned in the lab notes and Scripting Notes booklet. (Note
that the examples in the lecture notes are not to be considered good examples of scripting standards
as implementation of some aspects of the standards was intentionally omitted to allow the code to
fit on a single lecture slide.)
Thanks a lot
- Tags:
- scripting
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2010 04:23 AM
05-08-2010 04:23 AM
Re: writing one script
> i need to [write a] basic script [...]
What's stopping you?
> The basic script, named "logmon" (for log
> monitor) will need to do the following:
> [...]
Sounds like a good homework problem. Perhaps
you should try to do it yourself.
> [...] de ned [...]
"defined"? (If you can't do copy+paste, I
can see why you might seek help.)
What's stopping you?
> The basic script, named "logmon" (for log
> monitor) will need to do the following:
> [...]
Sounds like a good homework problem. Perhaps
you should try to do it yourself.
> [...] de ned [...]
"defined"? (If you can't do copy+paste, I
can see why you might seek help.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2010 12:39 AM
05-09-2010 12:39 AM
Re: writing one script
For basic of scripting:
http://www.tldp.org/LDP/abs/html/index.html
SNS
http://www.tldp.org/LDP/abs/html/index.html
SNS
"Genius is 1% inspiration, 99% Perspiration" - Edison
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2010 08:28 AM
05-09-2010 08:28 AM
Re: writing one script
Hi:
> generally follow good scripting practice as de ned in the lab notes and Scripting Notes booklet. (Note that the examples in the lecture notes are not to be considered good examples of scripting standards as implementation of some aspects of the standards was intentionally omitted to allow the code to fit on a single lecture slide.)
This site isn't appropriate for homework assignments.
You will learn more from your course by trying its assignments yourself, rather than claiming someone else's offering as your own. Whether or not your attempts work well is immaterial.
...JRF...
> generally follow good scripting practice as de ned in the lab notes and Scripting Notes booklet. (Note that the examples in the lecture notes are not to be considered good examples of scripting standards as implementation of some aspects of the standards was intentionally omitted to allow the code to fit on a single lecture slide.)
This site isn't appropriate for homework assignments.
You will learn more from your course by trying its assignments yourself, rather than claiming someone else's offering as your own. Whether or not your attempts work well is immaterial.
...JRF...
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