But I do encounter such a question:
case 1:
use strict; my $cmd = "dumpcap -i eth0 -b duration:10 -w \\media\\Work\\abc.pcap"; `$cmd`"dumpcap" itself will print some infomation, if I add 2>&1 behind $cmd, such as `$cmd 2>&1`, no infomation displayed. But if I do not add 2>&1, information do displays
in another case, If I change $cmd to :
my $cmd = "ifconfig";There is no information displayed in shell no matter If I add 2>&1 or not
Why is this difference ?
In reply to Re^2: how does '2>&1' work ?
by wildnature
in thread how does '2>&1' work ?
by wildnature
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |