Sponsored Content
Full Discussion: Need help with script.
Top Forums Shell Programming and Scripting Need help with script. Post 302349957 by taekwondo on Wednesday 2nd of September 2009 11:31:08 AM
Old 09-02-2009
Bug Need help with script.

Hi:

I am using linux and trying to format logs. I have grepped for stuff like invalid users and /or error. However, the way the logs are formatted, sometimes the full error is not on the line, ie. it is on the next line. If I grep something, like:
cat /var/spool/mail/* |grep -i session |awk '{print $5}'
The information I want is in the log on the next line. Is there a way to get the following lines anyone can think of? Thanks so much for your help in advance.
Henry
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

5. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
Logger(3pm)						  LogReport's Lire Documentation					       Logger(3pm)

NAME
Lire::Logger - Lire's logging interface. SYNOPSIS
Any program: use Lire::Logger qw/ lr_info lr_debug lr_warn /; lr_info( "doing stuff " ); lr_debug( "debugging information" ); lr_warn( "encountered unexpected value: ", $value ); open( CFGFILE, "my.conf" ) or lr_err( "open error: ", $! ); DESCRIPTION
This module contains functions that should be used by everything in the Lire framework which should need logging. All logging functions take any number of parameters that will be joined together to form the message (like print(), die(), warn() and friends). lr_emerg() This logs a message at the "emerg" level and aborts your program. This probably shouldn't be used. lr_crit() This logs a message at the "crit" level and aborts your program. This should only be used when something is really broken in the Lire program or the environment. It is used a few places in Lire when assertion that should really never fail (like a DLF file with the wrong number of fields). lr_err() This logs a message at the "err" level and usually aborts your program. (It is the equivalent of a die().) The program won't abort if it's used in an eval block. Uses this for error condition. lr_warn() This logs a message at the "warning" level. Perl's builtin warn is mapped to this function. Use this for non-fatal errors. lr_notice() This logs a message at the "notice" level. This should be used for significant informational messages that the user should see. (By default, the user will only see messages at level "notice" or higher.) lr_info() This logs a message at the "info" level. Use this for general informational messages. lr_debug() This logs a message at the "debug" level. Use this for debugging messages. SEE ALSO
Lire::Program(3pm) AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: Logger.pm,v 1.10 2006/07/23 13:16:29 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001-2003 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 Logger(3pm)
All times are GMT -4. The time now is 04:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy