05-03-2011
Quote:
Originally Posted by
NelsonC
Sort of actually the reverse, I am tailing the log and those are key words I do not want to see
I am filtering them out of the tail.
Well..... there's always a '-v' option to combine with.....
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am running a script where i need to run another command in a particular folder which I do not have access so I need
to login as su to that folder and run that script...what are the options I need so that I
can skip interactive mode ..here is what I tried..
#! /usr/bin/sh... (1 Reply)
Discussion started by: mgirinath
1 Replies
2. Shell Programming and Scripting
Hi,
I am trying to write a script to search a log- IPaddress being the search criteria, I would ideally like the script to ask the ipaddress
Enter IP address - 244.258.27.225
And the ideal result would be for the script to get all the entries in the log file for a particular IP address,... (3 Replies)
Discussion started by: fuzion.hyd
3 Replies
3. Shell Programming and Scripting
Hello,
I only know the basic for shell programing. I need help for this, I thinks this is a basic for anyone who know a litle of shell scripting.
I need creat a script for a rotatate logs, when a filesystem is full. I have a filesystem.
The rotate consist in zip the current log (copy) and... (1 Reply)
Discussion started by: El Rengo
1 Replies
4. Shell Programming and Scripting
Can we write any command/Script....to find out the data in a log file for last 5 mins? (2 Replies)
Discussion started by: shilpaamu
2 Replies
5. Shell Programming and Scripting
I have a log which is configured as follows:
date time code1 notes: code2
A monthly job is run based on information supplied from this log. The end of each monthly job is clearly indicated by a code within 'code1'. At this time someone is performing a less on the log, moving to the end,... (2 Replies)
Discussion started by: bwatlington
2 Replies
6. HP-UX
AM in need of some plugin/script that can monitor HP-UX file "/var/opt/resmon/log/event.log" .
Have written a scrip in sh shell that is working fine for syslog.log and mail.log as having standard format, have interrogated that to Nagios and is working as I required .
But same script failed to... (3 Replies)
Discussion started by: Shirishlnx
3 Replies
7. Shell Programming and Scripting
Hi all,
Am trying to write my own log rotate script. Curremtly, what I have is as below:
#!/bin/ksh
file_to_rotate=${1}
x=${2}
while ]
do
let curr=${x}
let prev=${x}-1
if ] ; then
#echo "cp -p ${file_to_rotate} ${file_to_rotate}.${curr}"
cp -p... (7 Replies)
Discussion started by: newbie_01
7 Replies
8. Shell Programming and Scripting
# cat /tmp/checkdate.log
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 17 22:49:00 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
FIRST_TIME NEXT_TIME... (1 Reply)
Discussion started by: SarwalR
1 Replies
9. Shell Programming and Scripting
Hi Team -
I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n?
%~n is a DOS variable that dispayed the script name.
For instance (in DOS):
REM... (11 Replies)
Discussion started by: SIMMS7400
11 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am totally a newbie to any programming languages and I just started an entry level job in an IT company. One of my recent tasks is to create a script that is able to show the log file of linux service (i.e. ntpd service)
lets say, if I run my script ./test.sh, the output should be... (3 Replies)
Discussion started by: xiaogeji
3 Replies
LEARN ABOUT DEBIAN
sort::key::maker
Sort::Key::Maker(3pm) User Contributed Perl Documentation Sort::Key::Maker(3pm)
NAME
Sort::Key::Maker - multikey sorter creator
SYNOPSYS
# create a function that sorts strings by length:
use Sort::Key::Maker sort_by_length => sub { length $_}, qw(integer);
# create a multikey sort function;
# first key is integer sorted in descending order,
# second key is a string in default (ascending) order:
use Sort::Key::Maker ri_s_keysort => qw(-integer string);
# some sample data...
my @foo = qw(foo bar t too tood mama);
# and now, use the sorter functions previously made:
# get the values on @foo sorted by length:
my @sorted = sort_by_length @foo;
# sort @foo inplace by its length and then by its value:
ri_s_keysort_inplace { length $_, $_ } @foo;
DESCRIPTION
Sort::Key::Maker is a pragmatic module that provides an easy to use interface to Sort::Key multikey sorting functionality.
It creates multikey sorting functions on the fly for any key type combination and exports them to the caller package.
The key types natively accepted are:
string, str, locale, loc, integer, int,
unsigned_integer, uint, number, num
and support for other types can be added via Sort::Key::Register (or also via Sort::Key::register_type()).
USAGE
use Sort::Key::Maker foo_sort => @keys;
exports two subroutines to the caller package: "foo_sort (&@)" and "foo_sort_inplace (&@)".
Those two subroutines require a sub reference as their first argument and then respectively, the list to be sorted or an array.
For instance:
use Sort::Key::Maker bar_sort => qw(int int str);
@bar=qw(doo tomo 45s tio);
@sorted = bar_sort { unpack "CCs", $_ } @bar;
# or sorting @bar inplace
bar_sort_inplace { unpack "CCs", $_ } @bar;
use Sort::Key::Maker foo_sort => &genmultikey, @keys;
when the first argument after the sorter name is a reference to a subroutine it is used as the multikey extraction function. The
generated sorter functions doesn't require neither accept one, i.e.:
use Sort::Key::Maker sort_by_length => sub { length $_ }, 'int';
my @sorted = sort_by_length qw(foo goo h mama picasso);
SEE ALSO
Sort::Key, Sort::Key::Register.
Sort::Maker also available from CPAN provides similar functionality.
AUTHOR
Salvador Fandin~o, <sfandino@yahoo.com>
COPYRIGHT AND LICENSE
Copyright (C) 2005 by Salvador Fandin~o
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
perl v5.14.2 2010-04-16 Sort::Key::Maker(3pm)