|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to redirect the STDERR to a variable in perl?
in my perl script i tried the below statement Code:
$result = `cleartool rmstream -f $s1 1> /dev/null`; so as to redirect then error messages,when i print the $result ,it seems to be Null. Last edited by radoulov; 08-27-2010 at 06:27 AM.. Reason: Please use code tags! |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
$result = `cleartool rmstream -f $s1 2> /dev/null`; Last edited by radoulov; 08-27-2010 at 06:27 AM.. Reason: Please use code tags! |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
You are jus redirecting the stderr to /dev/null, i want the error message to be stored in a variable
|
|
#4
|
||||
|
||||
|
Try: Code:
$result = `cleartool rmstream -f $s1 2>&1 >/dev/null`; |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
And you can get a more detailed explanation in the FAQ:
Quote:
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Redirect just stderr to a file with a timestamp | mbak | UNIX for Dummies Questions & Answers | 5 | 10-15-2008 01:17 AM |
| How to redirect stderr and stdout to a file | sushantnirwan | Shell Programming and Scripting | 8 | 08-28-2008 09:23 AM |
| can't redirect stderr in bash | lumix | Shell Programming and Scripting | 3 | 12-16-2007 03:28 AM |
| how to redirect stderr from top with csh | umen | Shell Programming and Scripting | 2 | 02-23-2007 12:19 AM |
| Redirect stdout and stderr | zcurtis | Shell Programming and Scripting | 8 | 09-02-2002 06:13 AM |
|
|