redirect output to log file | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

redirect output to log file

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-07-2007
kalyanraj kalyanraj is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 11 June 2007, 12:39 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
redirect output to log file

hello all,

I'm invoking the program generate-report using backticks from my perl program and redirecting the output to the log file sge-stderr.log. But when i check the process using ps command it is spawing two processes where the below code is parent process and the program generate-report as child.

Please help me out of how to redirect the output to the log file without spawing two process.


Code:
`/usr/bin/perl /opt/finance/bin/generate-report $urid 2>> /opt/finance/logs/sge-stderr.log`;

Thanks a ton,
raj
Sponsored Links
    #2  
Old 06-07-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
When you use the system() or the backticks in perl, the program will do a fork and exec. This will result in two processes. Why is there a restriction on the number of processes that you can create?
Sponsored Links
    #3  
Old 06-07-2007
kalyanraj kalyanraj is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 11 June 2007, 12:39 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
one process has sh -c at the beginning of /usr/bin/perl /opt/finance/bin/generate-report $urid 2>> /opt/finance/logs/sge-stderr.log at the beginning and actual program opt/finance/bin/generate-report $urid is running which is the child process of first one.

Will there be any impact or two processes are making the same program running twice... iam confused

Please explain me...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to redirect output of ls to a file? girish.raos Shell Programming and Scripting 6 09-21-2010 06:13 AM
Redirect the output to a .xls file anupdas Shell Programming and Scripting 5 01-25-2010 04:26 AM
redirect output to a file name csecnarf UNIX for Dummies Questions & Answers 7 06-16-2008 04:45 AM
redirect output to file xadamz23 Shell Programming and Scripting 4 06-29-2006 12:20 PM
redirect output to file? slackware Shell Programming and Scripting 1 09-12-2003 03:57 AM



All times are GMT -4. The time now is 12:42 AM.