09-02-2010
Great. thanks for the help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello:
I'm a very newbee at UNIX/AIX.
What i want to do is to tail a file from the bottom until a certain string is found and write all the lines after the found string to another file.
I've tried out a lot of combination with tail and grep but doesn't find the good one.
Could someone help... (4 Replies)
Discussion started by: Felix2511
4 Replies
2. Shell Programming and Scripting
Hello all,
I have some weird problem that kinda baffles me. Say I have the following test file:
claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah, this is the third test line
Then say I want to tail the file, grep for the word "third" then... (7 Replies)
Discussion started by: sylaan
7 Replies
3. Shell Programming and Scripting
I'm trying to use tail/grep to monitor a log file. The command I cooked up is:
tail -n 50 -f output.log | grep 'type:system' | cut -f 5-
A sample line from the log file is:
1208894862 type:system session:0 severity:4 load started
the columns are tab delimited.
this works ok, except... (3 Replies)
Discussion started by: WasabiVengeance
3 Replies
4. Shell Programming and Scripting
Hi,
I am writing a shell script that checks catalina logs on a production system and mails me if it detects errors.
It greps the logs for known errors which i have defined as variables.
The problem is the logs are huge, approx 30,000 before they rotate.
So I am forced to use grep instead... (3 Replies)
Discussion started by: Moxy
3 Replies
5. Shell Programming and Scripting
The program that is running on my machine generates log files. I want to be able to know the number of lines that contain "FT" in the most recent log file. I wrote the following, but it always returns zero. And I know the count is not zero. Any ideas?
ls -rt *.log | tail -n 1 | grep -c FT (6 Replies)
Discussion started by: sdilucca
6 Replies
6. UNIX for Dummies Questions & Answers
I need to tail -f a file so I can monitor it as it is being written to. However, there is a lot of garbage in the file that I don't care about. So normally I would just pipe and grep for the string that is important to me. However, in this case, there are two things I need to grep for. I can't... (3 Replies)
Discussion started by: Silver11
3 Replies
7. UNIX for Dummies Questions & Answers
Hi -- I'm looking to write to a file after piping output from tail -f through to grep:
#write to a file for all lines with "searchtext" within in error_log:
Expand|Select|Wrap|Line Numbers
tail -f /var/error_log | grep searchtext > output.txt
The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies
8. Shell Programming and Scripting
Hi
I have a file which is updated very frequently.
Where in i wanted to use tail -f command in the script and wanted to grep for a particular word.
But the issue is when i use tail -f filename|grep "word" ...
it will show me blank until the word is found in the real time. if it shows... (13 Replies)
Discussion started by: nikhil jain
13 Replies
9. UNIX for Dummies Questions & Answers
hi guys,
I perform a sort of monitoring. I have a server running and with
tail -f | grep "Searchstring"I monitor the log-file for recent specific entries. This is ok and works fine.
Now, in addition I want to have my search results not posted into the shell but into a file. I tried:
tail... (3 Replies)
Discussion started by: LaUs3r
3 Replies
10. Shell Programming and Scripting
Good Morning,
i ran into some trouble this morning while 'improving' my monitoring stuff. i would like to get a warning when the number of mails sent (outbound) by postfix is above a certain number. so far, so easy. to test that i simply put
cat /var/log/mail.info | grep 'to=<' | grep -v -e... (1 Reply)
Discussion started by: Mike
1 Replies
LEARN ABOUT DEBIAN
sgmls::output
Output(3pm) User Contributed Perl Documentation Output(3pm)
NAME
SGMLS::Output - Stack-based Output Procedures
SYNOPSIS
use SGMLS::Output;
To print a string to the current output destination:
output($data);
To push a new output level to the filehandle DATA:
push_output('handle',DATA);
To push a new output level to the file "foo.data" (which will be opened and closed automatically):
push_output('file','foo.data');
To push a new output level to a pipe to the shell command "sort":
push_output('pipe','sort');
To push a new output level appending to the file "foo.data":
push_output('append','foo.data');
To push a new output level to an empty string:
push_output('string');
To push a new output level appending to the string "David is ":
push_output('string',"David is ");
To push a new output level to The Great Beyond:
push_output('nul');
To revert to the previous output level:
pop_output();
To revert to the previous output level, returning the contents of an output string:
$data = pop_output();
DESCRIPTION
This library allows redirectable, stack-based output to files, pipes, handles, strings, or nul. It is especially useful for packages like
SGMLS, since handlers for individual SGML elements can temporarily change and restore the default output destination. It is also particu-
larly useful for capturing the contents of an element (and its sub-elements) in a string.
Example:
sgmls('<title>', sub{ push_output('string'); });
sgmls('</title>', sub{ $title = pop_output(); });
In between, anything sent to output (such as CDATA) will be accumulated in the string returned from pop_output().
Example:
sgmls('<tei.header>', sub { push_output('nul'); });
sgmls('</tei.header>', sub { pop_output(); });
All output will be ignored until the header has finished.
AUTHOR AND COPYRIGHT
Copyright 1994 and 1995 by David Megginson, "dmeggins@aix1.uottawa.ca". Distributed under the terms of the Gnu General Public License
(version 2, 1991) -- see the file "COPYING" which is included in the SGMLS.pm distribution.
SEE ALSO
:
SGMLS.
perl v5.8.8 2004-02-22 Output(3pm)