The UNIX and Linux Forums  

Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error messages in /var/adm/messages nitinp82 UNIX for Advanced & Expert Users 1 04-17-2007 10:17 AM
Telnet Server FTP warning messages 500 'AUTH GSSAPI' how to resolve?? csviking UNIX for Dummies Questions & Answers 0 07-10-2006 06:04 AM
redirecting gcc messages rakkota High Level Programming 3 04-06-2006 03:48 PM
[ID 882636 kern.warning] WARNING: interrupt level 11 not serviced voxure SUN Solaris 9 01-30-2006 05:49 AM
Redirecting svh High Level Programming 5 08-22-2005 12:08 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-20-2007
keka keka is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 1
Redirecting the warning messages.

I have written a Perl module. We know that we have to include the "-w" option in the first line as good programming practise.
#! /usr/bin/perl -w

Now when i use this,it gives me a number of warnings which are pretty much harmless as the code works perfectly fine without the -w option.

Now i want to know if i can still use this -w option and redierct these warning messages to another file???

Thank you.
  #2 (permalink)  
Old 03-20-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
You can do this easily from the shell - assuming that -w outputs to stderr. If it does, then when you run the script, just run it like this:

./script_name 2> /tmp/script_name_warnings
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0