Sponsored Content
Full Discussion: Help with debug the script
Top Forums Shell Programming and Scripting Help with debug the script Post 302354111 by Vitoriung on Thursday 17th of September 2009 06:08:52 AM
Old 09-17-2009
Well I have bunch of log files, their names contains MAGT, DISP GWCO etc..., inside the files there is many lines like
Code:
[40000] (06/18 00:16:37.077):{0x22A0} {Hofer, Marc} PopulateMessage mbsync=1454490, RefId=0, Delivered=Thu Jun 18 00:16:28 2009 GWID=4A39875C.AT-W-SD.AT-WIEN.100.136306C.1.4C0A2.1
[40287] (06/18 00:16:37.186):{0x22A0} {Hofer, Marc} Queuing message, RefId=-1323204051, EntryId=43596, Posted=06/18 00:16:28

task is to supply parameter refid=$1(-1323204051), then find another variable thread=0x22A0, then mbsync=1454490

I can then use variable $mbsync to search in another file for another variables and when I get all variables needed I will then display all important lines with variables on the end of the script.

> /tmp/resRA-$$ generated random file, it's used for sed to filter the actual variable, this method may be difficult, but I've never had any problem with it, but if there is any easier way I will be happy to use it.

I wanted as well to make script managing different input variables like supply GWID instead of the refid and do the same procedure, but don't know how to do it. As a workaround I have another script with the same code but $1 is not refid but GWID.

Cheers

Last edited by Vitoriung; 09-18-2009 at 05:45 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Debug an Awk Script

I would like to extract the following fields from the text file attached. I copied the contents from a pdf file and pasted them into the text file so I can use awk to extract them. The layout is as listed below. name1,name2,name3,name4,Title,designation,nationality,dob, national ... (1 Reply)
Discussion started by: mboro
1 Replies

2. Shell Programming and Scripting

How to debug the awk script

Hi, How can I debug an awk script? I know that set -x can be used to debug a script. But this will not suite for awk scripts. Can anyone help me? Thanks in advance, Chella (2 Replies)
Discussion started by: chella
2 Replies

3. Shell Programming and Scripting

debug this script

echo "input time in hhmmss" read $st h=`echo $st | cut -c1-2` min=`echo $st | cut -c3-4` s=`echo $st | cut -c5-6` echo "input time in hhmmss" read $end h1=`echo $end | cut -c1-2` min1=`echo $end | cut -c3-4` s1=`echo $end | cut -c5-6` x= `expr $h /* 60 + $min` y= `expr $h1 /* 60 +... (8 Replies)
Discussion started by: abhishek27
8 Replies

4. UNIX for Advanced & Expert Users

How can debug our UNIX shell script?

Hi all, i have two simple questions here... 1. i want to know that how to debug the UNIX shell script? 2. is there any way to handling the exception in UNIX shell script like oracle exception handling? Please provide me those details it would be great help/ Thanks and Regards, MPS... (3 Replies)
Discussion started by: psiva_arul
3 Replies

5. Shell Programming and Scripting

If condition error-please debug my script

Hi All, I have a script which is based on calculating current time The script looks like this: whenever i try to run the script it gives me error:Please advice wherther i have made mistake with if condition or with for loop?? The code : set -x #!/usr/bin/ksh set -x... (7 Replies)
Discussion started by: usha rao
7 Replies

6. Shell Programming and Scripting

Problem with the script, help me debug

Hi, When i run the script ./script.sh sun, this give me no output, it should give me the list of file. If i run the script without the argument it should send me echo inside usage(). What is the problem? please help -Adsi #!/bin/sh ROOT_PATH=/net/icebox/vol/local_images/spins... (2 Replies)
Discussion started by: asirohi
2 Replies

7. Shell Programming and Scripting

Cant debug shell script

Hi I am relatively new in shell scripting Below is the code which i developed but for some reason, it keeps giving me error: /apps/bss/BatchProg/at1/batch/scripts/ksh/TBATLC02.ksh: syntax error at line 41 : `then' unmatched #!/usr/bin/ksh... (4 Replies)
Discussion started by: scripting_newbe
4 Replies

8. Shell Programming and Scripting

Debug script already running

Hello, is it possible to debug a script that is already running "on-demand"? Somehow a command like "set -x" but once you've executed the script. And another one to disable debugging? Thank you (0 Replies)
Discussion started by: asanchez
0 Replies

9. Shell Programming and Scripting

Debug perl script

Hi, I am trying to get squid up and running using a redirector process, and every time I try to load a web page, squid fails miserably. Can some one with perl and squid knowledge take a look at these codes and tell if something is wrong here. #!/usr/bin/perl # $| = 1; @endings = qw/... (0 Replies)
Discussion started by: jamie_123
0 Replies

10. Ubuntu

Debug script

How can I debug this script? I want to know what it is doing or not doing? #!/bin/bash # # if ; then # Do the thing you want before suspend here echo "we are suspending." > /tmp/systemd_suspend_test.txt elif ; then # Do the thing you want after resume here echo "and we are... (21 Replies)
Discussion started by: drew77
21 Replies
_REQUEST(3)								 1							       _REQUEST(3)

$_REQUEST - HTTP Request variables

	An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE.

       +--------+---------------------------------------------------+
       |Version |						    |
       |	|						    |
       |	|		     Description		    |
       |	|						    |
       +--------+---------------------------------------------------+
       | 5.3.0	|						    |
       |	|						    |
       |	|  Introduced request_order. This directive affects |
       |	| the contents of $_REQUEST.			    |
       |	|						    |
       | 4.3.0	|						    |
       |	|						    |
       |	|  $_FILES information was removed from $_REQUEST.  |
       |	|						    |
       | 4.1.0	|						    |
       |	|						    |
       |	|		Introduced $_REQUEST.		    |
       |	|						    |
       +--------+---------------------------------------------------+
       Note

	      This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes  throughout	a  script.
	      There is no need to do global $variable; to access it within functions or methods.

       Note

	       When running on the command line , this will not include the argv and argc entries; these are present in the $_SERVER array.

       Note

	       The  variables  in $_REQUEST are provided to the script via the GET, POST, and COOKIE input mechanisms and therefore could be modi-
	      fied by the remote user and cannot be trusted. The presence and order of variables listed in this array is defined according to  the
	      PHP variables_order configuration directive.

       import_request_variables(3), Handling external variables, The filter extension.

PHP Documentation Group 													       _REQUEST(3)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy