Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

To view the log of a function

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-10-2013   -   Original Discussion by saj
saj's Unix or Linux Image
saj saj is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 8 March 2013, 7:24 AM EST
Posts: 29
Thanks: 4
Thanked 0 Times in 0 Posts
To view the log of a function

I have a function like this

Code:
 
validate()
{
/* Inside this I will do some activites
}

How I can redirect this function to a log file , so that If I look into that log file I can understand ,is there any error happened inside the function or not

Last edited by Scott; 01-10-2013 at 07:09 AM.. Reason: Code tags
Sponsored Links
    #2  
Old Unix and Linux 01-10-2013   -   Original Discussion by saj
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 12 December 2017, 12:57 PM EST
Location: Aachen, Germany
Posts: 11,789
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
Well, what be the system (shell, language, ...)?
Sponsored Links
    #3  
Old Unix and Linux 01-10-2013   -   Original Discussion by saj
saj's Unix or Linux Image
saj saj is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 8 March 2013, 7:24 AM EST
Posts: 29
Thanks: 4
Thanked 0 Times in 0 Posts
I am using shell scripting
    #4  
Old Unix and Linux 01-10-2013   -   Original Discussion by saj
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 12 December 2017, 12:57 PM EST
Location: Aachen, Germany
Posts: 11,789
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
Well, there's many a shell in them there hills. If it were bash, you could set -vx; cf man bash:
Quote:
-v Print shell input lines as they are read.
-x After expanding each simple command, for command, case command, select command, or arithmetic for command, display the expanded value of PS4, followed by the command and its expanded arguments or associated word list.
Use redirection into a log file to be read/evaluated later.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can view log messages between two time frame from /var/log/message or any type of log files johnveslin Shell Programming and Scripting 1 07-15-2011 03:41 AM
View LOG messages jois UNIX for Dummies Questions & Answers 1 04-30-2011 05:09 AM
Read Table,View,Package,Function and Procedure Name in a File sboss Shell Programming and Scripting 5 10-01-2010 12:24 PM
view log files sak900354 UNIX for Dummies Questions & Answers 5 06-15-2006 08:26 AM
Open view log location zp523444 HP-UX 0 02-13-2006 09:46 PM



All times are GMT -4. The time now is 01:57 PM.