public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] shell ouput which file descriptor
@ 2010-04-09 15:19 Harry Putnam
  2010-04-09 21:59 ` [gentoo-user] " walt
  0 siblings, 1 reply; 5+ messages in thread
From: Harry Putnam @ 2010-04-09 15:19 UTC (permalink / raw
  To: gentoo-user

This is not a question about cvs... its only used for example.

I'm puzzled about a change in what I see when I run 
   cvs -n update 2> /dev/null

I've apparently lost the ability to remove stder from output.

I used that command to trim out file descriptor 2 which used to leave
a list of any changed files in the repo on the console, for a very
long time.


Suddenly there is no difference with:

      cvs -n update 2> /dev/null
         cvs -n update 

The stuff on stderr still shows in the ouput either way.

Further; 
  cvs -n update 2>er  (redirect stder to ./er)

Doesn't put anything in ./er

However cvs -n update 1>out   (redirect stdout to ./out)

Does catch the output I'm after and leave out stderr. (as one would
expect) 

So, again, apparently I've lost the ability to trim out stderr with a
redirect to /dev/null (cvs -n update 2> /dev/null)

-------        ---------       ---=---       ---------      --------

The only thing I've been tinkering with is evaluating the
/etc/DIR_COLORS file.  I switched from evaluating a custom version to
evaluating the default version.

That's when I first noticed the file descriptor anomaly but not sure
if was going before since I didn't notice it before.

So changed back to the original dir_colors... but the descriptor
problem is still here.

I've established a fresh login by ssh myusr@localhost

Still I see stderr in the console even when redirected with
  2> /dev/null

Anyone have an idea what I've done here, or what might explain what
I'm seeing?







^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] Re: [OT] shell ouput which file descriptor
  2010-04-09 15:19 [gentoo-user] [OT] shell ouput which file descriptor Harry Putnam
@ 2010-04-09 21:59 ` walt
  2010-04-10 15:11   ` Harry Putnam
  0 siblings, 1 reply; 5+ messages in thread
From: walt @ 2010-04-09 21:59 UTC (permalink / raw
  To: gentoo-user

On 04/09/2010 08:19 AM, Harry Putnam wrote:
> This is not a question about cvs... its only used for example.
>
> I'm puzzled about a change in what I see when I run
>     cvs -n update 2>  /dev/null
>
> I've apparently lost the ability to remove stder from output.
>
> I used that command to trim out file descriptor 2 which used to leave
> a list of any changed files in the repo on the console, for a very
> long time.
>
>
> Suddenly there is no difference with:
>
>        cvs -n update 2>  /dev/null
>           cvs -n update
>
> The stuff on stderr still shows in the ouput either way.
>
> Further;
>    cvs -n update 2>er  (redirect stder to ./er)
>
> Doesn't put anything in ./er
>
> However cvs -n update 1>out   (redirect stdout to ./out)
>
> Does catch the output I'm after and leave out stderr. (as one would
> expect)
>
> So, again, apparently I've lost the ability to trim out stderr with a
> redirect to /dev/null (cvs -n update 2>  /dev/null)
>
> -------        ---------       ---=---       ---------      --------
>
> The only thing I've been tinkering with is evaluating the
> /etc/DIR_COLORS file.  I switched from evaluating a custom version to
> evaluating the default version.

I have no helpful advice, but I would try a couple of simple experiments:

I have this in my home directory because I'm color blind:
-rw-r--r--  1 wa1ter users       0 2007-08-27 18:29 .dir_colors

$cat nonexistantfile
cat: nonexistantfile: No such file or directory

$cat nonexistantfile 2> /tmp/testfile
$

$cat /tmp/testfile
cat: nonexistantfile: No such file or directory

Are you running cvs as root, or user, or ...?






^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] Re: [OT] shell ouput which file descriptor
  2010-04-09 21:59 ` [gentoo-user] " walt
@ 2010-04-10 15:11   ` Harry Putnam
  2010-04-10 16:17     ` Harry Putnam
  0 siblings, 1 reply; 5+ messages in thread
From: Harry Putnam @ 2010-04-10 15:11 UTC (permalink / raw
  To: gentoo-user

walt <w41ter@gmail.com> writes:

> On 04/09/2010 08:19 AM, Harry Putnam wrote:
>> This is not a question about cvs... its only used for example.
>>
>> I'm puzzled about a change in what I see when I run
>>     cvs -n update 2>  /dev/null
>>
>> I've apparently lost the ability to remove stder from output.
>>
>> I used that command to trim out file descriptor 2 which used to leave
>> a list of any changed files in the repo on the console, for a very
>> long time.
>>
>>
>> Suddenly there is no difference with:
>>
>>        cvs -n update 2>  /dev/null
>>           cvs -n update
>>
>> The stuff on stderr still shows in the ouput either way.
>>
>> Further;
>>    cvs -n update 2>er  (redirect stder to ./er)
>>
>> Doesn't put anything in ./er
>>
>> However cvs -n update 1>out   (redirect stdout to ./out)
>>
>> Does catch the output I'm after and leave out stderr. (as one would
>> expect)
>>
>> So, again, apparently I've lost the ability to trim out stderr with a
>> redirect to /dev/null (cvs -n update 2>  /dev/null)
>>
>> -------        ---------       ---=---       ---------      --------
>>
>> The only thing I've been tinkering with is evaluating the
>> /etc/DIR_COLORS file.  I switched from evaluating a custom version to
>> evaluating the default version.
>
> I have no helpful advice, but I would try a couple of simple experiments:
>
> I have this in my home directory because I'm color blind:
> -rw-r--r--  1 wa1ter users       0 2007-08-27 18:29 .dir_colors
>
> $cat nonexistantfile
> cat: nonexistantfile: No such file or directory
>
> $cat nonexistantfile 2> /tmp/testfile
> $
>
> $cat /tmp/testfile
> cat: nonexistantfile: No such file or directory

Thanks... 

> Are you running cvs as root, or user, or ...?

I was running cvs as user, and now trying your tests... it appears the
trouble has stopped... doesn't occur now in cvs cmds either.

There was a reboot in between, so may never now what was going on.

Prior to rebooting I had tried to get a fresh env by ssh
user@localhost from an xterm.  Hoping to rule out some oddball env
problem, but the file descriptor problem persisted.  However it has
apparently not survived a reboot.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-user] Re: [OT] shell ouput which file descriptor
  2010-04-10 15:11   ` Harry Putnam
@ 2010-04-10 16:17     ` Harry Putnam
  2010-04-11  6:40       ` Amit Dor-Shifer
  0 siblings, 1 reply; 5+ messages in thread
From: Harry Putnam @ 2010-04-10 16:17 UTC (permalink / raw
  To: gentoo-user

Harry Putnam <reader@newsguy.com> writes:

>>
>> $cat /tmp/testfile
>> cat: nonexistantfile: No such file or directory
>
> Thanks... 
>
>> Are you running cvs as root, or user, or ...?
>
> I was running cvs as user, and now trying your tests... it appears the
> trouble has stopped... doesn't occur now in cvs cmds either.
>
> There was a reboot in between, so may never now what was going on.
>
> Prior to rebooting I had tried to get a fresh env by ssh
> user@localhost from an xterm.  Hoping to rule out some oddball env
> problem, but the file descriptor problem persisted.  However it has
> apparently not survived a reboot.

Yikes... more mysterious than I reported above.

I see now that I get the goofy acting file descriptors when I'm in
console mode, but not in X.

And it appears only to happen in cvs commands, but again, not in X.

My sequence:

   Reboot just now.

   At console login:

    login and call cvs command:

     cvs -n update /usr/local/common/base 2>er
     
     I see 83 lines scroll by.

    cat er
    cat: er: No such file or directory

    Nothing has been redirected.

    cvs -n update /usr/local/common/base 2>er|wc -l
    
    I still see 83 lines but wc -l reports 0
    (as it should)
    
    So somehow the redirect is ignored and stderr goes to console
    anyway. 

  Trying your test
  cat none 2>er
   
   cat er
   cat: none: No such file or directory

So stderr is doing what it is supposed to do with cat but not a cvs
command. 
-------        ---------       ---=---       ---------      -------- 
Now startx and from an xterm:
   cvs -n update /usr/local/common/base 2>er
   <no output> just like expected

Follow with:
    cat er|wc -l
  83 
  (83 lines of ouput were captured with 2>er)

So this is more puzzling than ever.  Weird phenomena in console that
stops when in X.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Re: [OT] shell ouput which file descriptor
  2010-04-10 16:17     ` Harry Putnam
@ 2010-04-11  6:40       ` Amit Dor-Shifer
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Dor-Shifer @ 2010-04-11  6:40 UTC (permalink / raw
  To: gentoo-user

permission issue?
any EACCES in strace output?
Amit

Harry Putnam wrote:
> Harry Putnam <reader@newsguy.com> writes:
>
>   
>>> $cat /tmp/testfile
>>> cat: nonexistantfile: No such file or directory
>>>       
>> Thanks... 
>>
>>     
>>> Are you running cvs as root, or user, or ...?
>>>       
>> I was running cvs as user, and now trying your tests... it appears the
>> trouble has stopped... doesn't occur now in cvs cmds either.
>>
>> There was a reboot in between, so may never now what was going on.
>>
>> Prior to rebooting I had tried to get a fresh env by ssh
>> user@localhost from an xterm.  Hoping to rule out some oddball env
>> problem, but the file descriptor problem persisted.  However it has
>> apparently not survived a reboot.
>>     
>
> Yikes... more mysterious than I reported above.
>
> I see now that I get the goofy acting file descriptors when I'm in
> console mode, but not in X.
>
> And it appears only to happen in cvs commands, but again, not in X.
>
> My sequence:
>
>    Reboot just now.
>
>    At console login:
>
>     login and call cvs command:
>
>      cvs -n update /usr/local/common/base 2>er
>      
>      I see 83 lines scroll by.
>
>     cat er
>     cat: er: No such file or directory
>
>     Nothing has been redirected.
>
>     cvs -n update /usr/local/common/base 2>er|wc -l
>     
>     I still see 83 lines but wc -l reports 0
>     (as it should)
>     
>     So somehow the redirect is ignored and stderr goes to console
>     anyway. 
>
>   Trying your test
>   cat none 2>er
>    
>    cat er
>    cat: none: No such file or directory
>
> So stderr is doing what it is supposed to do with cat but not a cvs
> command. 
> -------        ---------       ---=---       ---------      -------- 
> Now startx and from an xterm:
>    cvs -n update /usr/local/common/base 2>er
>    <no output> just like expected
>
> Follow with:
>     cat er|wc -l
>   83 
>   (83 lines of ouput were captured with 2>er)
>
> So this is more puzzling than ever.  Weird phenomena in console that
> stops when in X.
>
>
>
>   



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-11  6:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 15:19 [gentoo-user] [OT] shell ouput which file descriptor Harry Putnam
2010-04-09 21:59 ` [gentoo-user] " walt
2010-04-10 15:11   ` Harry Putnam
2010-04-10 16:17     ` Harry Putnam
2010-04-11  6:40       ` Amit Dor-Shifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox