[p4] Problem with redirecting stderr.

DAVID Foglesong defoglesong at msn.com
Wed Sep 19 08:39:23 PDT 2007


That's because on line 568 you've added & to redirect stdout to stdin. I bet 
if you look at your directory after this command:

560 > p4 client -o > /tmp/p4mkdeb.21384 2>1

You'll find a file named "1" that has the contents of stderr.

http://tldp.org/LDP/abs/html/io-redirection.html

David Foglesong


>From: "Steven W. Orr" <steveo at syslang.net>
>To: Perforce Users <perforce-user at perforce.com>
>Subject: [p4] Problem with redirecting stderr.
>Date: Wed, 19 Sep 2007 10:52:03 -0400 (EDT)
>
>In a shell script, I am testing to see if I am logged in. Please bear with
>me. Here are some lines from my console. I am *not* logged in to perforce
>
>560 > p4 client -o > /tmp/p4mkdeb.21384 2>1
>561 > cat  /tmp/p4mkdeb.21384
>562 > p4 client -o 2>&1 | cat > /tmp/p4mkdeb.21384
>563 > cat  /tmp/p4mkdeb.21384
>Your session has expired, please login again.
>564 > rm /tmp/p4mkdeb.21384
>565 > p4 client -o > /tmp/p4mkdeb.21384 2>1
>566 > cat  /tmp/p4mkdeb.21384
>567 > p4 client -o
>Your session has expired, please login again.
>568 > p4 client -o > xxx 2>&1
>569 > cat xxx
>Your session has expired, please login again.
>570 > rm /tmp/p4mkdeb.21384
>571 > p4 client -o 2>&1 | cat > /tmp/p4mkdeb.21384
>572 > cat  /tmp/p4mkdeb.21384
>Your session has expired, please login again.
>573 >
>
>On 560, I run client -o and on 561 I get an empty output file.
>On 562, I do the same thing but pass the output through a pipe and
>successfully catch the output.
>On 565, I do it again to prove to myself that I'm not nuts.
>On 567, I just sent it to the console so you can all see further that I'm
>not nuts.
>On 568, I change the output file to being in my local directory and now it
>works on 569.
>
>Server date: 2007/09/19 07:40:56 -0700 PDT
>Server version: P4D/LINUX24X86/2006.1/102189 (2006/06/27)
>Proxy version: P4P/LINUX26X86/2006.1/101890 (2006/06/21)
>
>If anyone can 'splain this one, I'd be fascinated to hear the answer.
>
>--
>Time flies like the wind. Fruit flies like a banana. Stranger things have  
>.0.
>happened but none stranger than this. Does your driver's license say Organ 
>..0
>Donor?Black holes are where God divided by zero. Listen to me! We are all- 
>000
>individuals! What if this weren't a hypothetical question?
>steveo at syslang.net
>_______________________________________________
>perforce-user mailing list  -  perforce-user at perforce.com
>http://maillist.perforce.com/mailman/listinfo/perforce-user

_________________________________________________________________
More photos; more messages; more whatever. Windows Live Hotmail - NOW with 
5GB storage. 
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907


More information about the perforce-user mailing list