how to write stderr in a subroutine log file?..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to write stderr in a subroutine log file?..
# 1  
Old 11-24-2005
how to write stderr in a subroutine log file?..

perl 5.6.1 in win2000:

my program uses a subroutine which will write log file. i will call that sub routine like this
&log_message("the file $inputfile opened");

what should i do to write the stderr on the same log file itself..

i tried to pass the stderr to the subroutine like
&log_message(\*STDERR);
and
&log_message(*STDERR) ;

but no use.,

dont know what to do...
# 2  
Old 11-24-2005
Please make sure that you have read our rules. And note:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

I will close this duplicate thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. Shell Programming and Scripting

Ksh: How to write the log file simultaneously when .sql file executes by UNIX process

Hello Team- we would like to implement an approach which has to write the log file simultaneously when .sql file is executing by Unix process. At present,it is writing the log file once the process is completed. I've tested the current process with the below approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies

3. Shell Programming and Scripting

Write log file for SFTP command

Hi I am transferring files to SFTP Server using sftp command(below), and want to write log file of this activity. Can you please advise if i am doing wrong. sftp -v -oIdentityFile=/home/bbm_user/bbm/private_open_ssh.ppm umf-sftp@bbm-prod-send.com <<EOF put $local_path/*.gz $remote_path/... (3 Replies)
Discussion started by: cnrj
3 Replies

4. Solaris

SMF in Solaris wont write to stderr/stdout ?

Hi, I got a process (c written) that we usually run this way : EmsChkQu >> /EMS/log/EmsChkQu.log 2>&1 When trying to use it as a service I defined it this way : <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle... (6 Replies)
Discussion started by: zionassedo
6 Replies

5. Shell Programming and Scripting

Have each subshell write stderr and stdout to its own logfile

Hello, As stated in the title, I do some hacked parallel processing by running multiple instances of bash scripts, each in their own subshell. The code looks like this, # launch one batch-train script in background for each value in fold group list for FOLD_GROUP in "${FOLD_GROUP_LIST}" do ... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

6. Shell Programming and Scripting

Write whatever error in log file

Hi all, I have export LOG_FILE=$HOME_DIR/error.log sqlplus -s /nolog << EOF whenever sqlerror exit sql.sqlcode @$HOME_DIR/connect.sql whenever sqlerror exit sql.sqlcode @$SQL_FILE EOF can display the sql error in putty, how can I write them into log file ?:( (2 Replies)
Discussion started by: Hscript
2 Replies

7. Shell Programming and Scripting

Write out specific data from log to a new file

I got a huge log in zipped files, i need to write out lines by specific data and if the line with the same contains XML message with the same sessionID will be written to the file to. The log structure: 2013-08-16 16:31:06,810 ( 122: rogate) INFO - UId:10453, GId:5422: new... (16 Replies)
Discussion started by: batka
16 Replies

8. Shell Programming and Scripting

Perl - pass file to subroutine

Hello All, I have 2 perl sub-routines. my $myDir = myDir_path; my $file; sub convert(){ system ("./$myConvertScript >> $myDir/$file_CONV" ); $file2 = $myDir/$file_CONV; } sub addDB(){ open(CONF, $config) or die "Cannot Open $config for reading. "; while(<CONF>){... (1 Reply)
Discussion started by: ad23
1 Replies

9. Programming

stderr stdout to a log file

I originally wrote my script using the korn shell and had to port it to bash on a another server. My script is working find for backing up but noticed that now after the move, I am not getting any output to my log files. Using Korn shell, this worked for me for some odd reason. This was sending... (2 Replies)
Discussion started by: metallica1973
2 Replies

10. Shell Programming and Scripting

passing "stderr " to a subroutine..

This is perl, v5.6.1 built for MSWin32-x86-multi-thread ----------- i thought to pass the stderr to the subroutine which writes in a log file.. when i use &log_message(\*STDERR); in the log file instead of the error messages, i am getting only this word ____________::GLOB(0x1ab507c) ... (1 Reply)
Discussion started by: sekar sundaram
1 Replies
Login or Register to Ask a Question