Sponsored Content
Full Discussion: Tracing a function call
Top Forums Shell Programming and Scripting Tracing a function call Post 302405709 by alister on Friday 19th of March 2010 04:18:48 PM
Old 03-19-2010
Hi:

Your code redirects stderr for the function to set.log2, so that's where all the trace output will be found. If the calling script is only reading stdout (from a pipe or coprocesses or fifo), you don't need that redirection.

Quote:
-x
The shell shall write to standard error a trace for each command after it expands the command and before it executes it. It is unspecified whether the command that turns tracing off is traced.
-- Shell Command Language

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. Programming

Help with a function call

Hi, Can anyone help me figure out the problem I'm having with a function call? I have a header file, which sets an enum: typedef enum {INFO, WARNING, FATAL} Levels; int log_event (Levels, char *fmt, ...); ..then the function is called this way: log_event(INFO, "Message text"); ... (6 Replies)
Discussion started by: Stevhp
6 Replies

2. Shell Programming and Scripting

call function

I have a function check_ok in my abc.sh. which return me 1 or 0 . I want to call this fuction through other shell script. this shell also send two parameter to calling function. Can you please tell me how. I am very new in unix. #!/bin/bash date_equal() { sqlplus -silent... (4 Replies)
Discussion started by: Jamil Qadir
4 Replies

3. Shell Programming and Scripting

function call

hi, can any one help me to correct this function call. awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 } if (tro == "") { $3 = search "$file2" "$first" "$file3" {print $1","$2","$3","$4} } else {print $1","$2","$3 $4}}' $file1 > $file search () { (2 Replies)
Discussion started by: kamel.seg
2 Replies

4. Shell Programming and Scripting

help on function call

hello, when i call function inside awk traitement it doesn't work, i don't have error execution but i don't get result and if i call the function outside awk traitement it work well.. there's something special in awk call function?? here is the example : awk -F "," '{ {first=$1; sec=$2;... (3 Replies)
Discussion started by: kamel.seg
3 Replies

5. Programming

Tracing Function Calls in a program

Apart from writing debug and statements in constructors is there any way by which we can trace the function call stack at any depth? The issue that we always face is that when program crashes (Web Server running on Linux) we have no idea where it crashes and we have to do the hard way of... (1 Reply)
Discussion started by: uunniixx
1 Replies

6. Programming

tracing function with Graphviz

I was searching for a tool to trace the function flow to help me understand the code. I came across the article "visualize function calls with graphviz" by Tim Jones. Visualize function calls with Graphviz I was able to obtain the flow diagram for simple programs and also for the example... (0 Replies)
Discussion started by: cjjoy
0 Replies

7. Shell Programming and Scripting

Function Call

Hi, I have a string corresponding to a function. How I can call that function without if statement? Thanks in advance. (4 Replies)
Discussion started by: Zaxon
4 Replies

8. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

9. Shell Programming and Scripting

After exit from function it should not call other function

Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this? iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

10. Shell Programming and Scripting

How to Call a Function

Hi I have created a function in a Shell Script test.sh function fnTest() { echo "My first Method } I have called this function in my test.sh cat abc.txt | grep "test" echo " test" fnTest But while running the shell script i got the following error: ... (2 Replies)
Discussion started by: nanthagopal
2 Replies
TraceMessages(3pm)					User Contributed Perl Documentation					TraceMessages(3pm)

NAME
Log::TraceMessages - Perl extension for trace messages used in debugging SYNOPSIS
use Log::TraceMessages qw(t d); $Log::TraceMessages::On = 1; t 'got to here'; t 'value of $a is ' . d($a); { local $Log::TraceMessages::On = 0; t 'this message will not be printed'; } $Log::TraceMessages::Logfile = 'log.out'; t 'this message will go to the file log.out'; $Log::TraceMessages::Logfile = undef; t 'and this message is on stderr as usual'; # For a CGI program producing HTML $Log::TraceMessages::CGI = 1; # Or to turn on trace if there's a command-line argument '--trace' Log::TraceMessages::check_argv(); DESCRIPTION
This module is a slightly better way to put trace statements into your code than just calling print(). It provides an easy way to turn trace on and off for particular sections of code without having to comment out bits of source. USAGE
$Log::TraceMessages::On Flag controlling whether tracing is on or off. You can set it as you wish, and of course it can be "local"-ized. The default is off. $Log::TraceMessages::Logfile The name of the file to which trace should be appended. If this is undefined (which is the default), then trace will be written to stderr, or to stdout if $CGI is set. $Log::TraceMessages::CGI Flag controlling whether the program printing trace messages is a CGI program (default is no). This means that trace messages will be printed as HTML. Unless $Logfile is also set, messages will be printed to stdout so they appear in the output page. t(messages) Print the given strings, if tracing is enabled. Unless $CGI is true or $Logfile is set, each message will be printed to stderr with a newline appended. trace(messages) Synonym for "t(messages)". d(scalar) Return a string representation of a scalar's value suitable for use in a trace statement. This is just a wrapper for Data::Dumper. "d()" will exit with '' if trace is not turned on. This is to stop your program being slowed down by generating lots of strings for trace statements that are never printed. dmp(scalar) Synonym for "d(scalar)". check_argv() Looks at the global @ARGV of command-line parameters to find one called '--trace'. If this is found, it will be removed from @ARGV and tracing will be turned on. Since tracing is off by default, calling "check_argv()" is a way to make your program print trace only when you ask for it from the command line. AUTHOR
Ed Avis, ed@membled.com SEE ALSO
perl(1), Data::Dumper(3). perl v5.8.8 2006-05-27 TraceMessages(3pm)
All times are GMT -4. The time now is 02:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy