9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] strange problem
@ 2010-07-19 11:40 Rudolf Sykora
  2010-07-19 12:14 ` roger peppe
  0 siblings, 1 reply; 4+ messages in thread
From: Rudolf Sykora @ 2010-07-19 11:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

when I run
% {for(i in 0.*) @{cd $i; echo $i; grep total otdit| grep -v number}}
0.0
total        :   1.6292960E-01
0.1
total        :   1.6304534E-01
0.2
total        :   1.6334587E-01
0.3
total        :   1.6371879E-01
0.4
total        :   1.6402583E-01
0.5
total        :   1.6414479E-01

which is what I want. But adding >data

% awd
% {for(i in 0.*) @{cd $i; echo $i; grep total otdit| grep -v number}} >data
% cat data
^[];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.0/-xeon4\a0.0
total        :   1.6292960E-01
^[];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.1/-xeon4\a0.1
total        :   1.6304534E-01
^[];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.2/-xeon4\a0.2
total        :   1.6334587E-01
^[];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.3/-xeon4\a0.3
total        :   1.6371879E-01
^[];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.4/-xeon4\a0.4
total        :   1.6402583E-01
0.5
total        :   1.6414479E-01
%

I don't understand...
This is using p9p.

Thanks for explanation!
Ruda



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

* Re: [9fans] strange problem
  2010-07-19 11:40 [9fans] strange problem Rudolf Sykora
@ 2010-07-19 12:14 ` roger peppe
  2010-07-19 12:24   ` Rudolf Sykora
  2010-07-19 12:50   ` erik quanstrom
  0 siblings, 2 replies; 4+ messages in thread
From: roger peppe @ 2010-07-19 12:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

that's because the cd function calls awd which prints some terminal
control codes to change the window's idea of the current
working directory. IMHO it should write to stderr,
but it doesn't.

 {for(i in 0.*) @{builtin cd $i; echo $i; grep total otdit| grep -v
number}} >data

should work.


On 19 July 2010 12:40, Rudolf Sykora <rudolf.sykora@gmail.com> wrote:
> Hello,
>
> when I run
> % {for(i in 0.*) @{cd $i; echo $i; grep total otdit| grep -v number}}
> 0.0
> total        :   1.6292960E-01
> 0.1
> total        :   1.6304534E-01
> 0.2
> total        :   1.6334587E-01
> 0.3
> total        :   1.6371879E-01
> 0.4
> total        :   1.6402583E-01
> 0.5
> total        :   1.6414479E-01
>
> which is what I want. But adding >data
>
> % awd
> % {for(i in 0.*) @{cd $i; echo $i; grep total otdit| grep -v number}} >data
> % cat data
>  ];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.0/-xeon4 0.0
> total        :   1.6292960E-01
>  ];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.1/-xeon4 0.1
> total        :   1.6304534E-01
>  ];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.2/-xeon4 0.2
> total        :   1.6334587E-01
>  ];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.3/-xeon4 0.3
> total        :   1.6371879E-01
>  ];/home/sykora/CALC/systems/fe_gaas_ag_001/17As_cp15/onek/rotxy/0.4/-xeon4 0.4
> total        :   1.6402583E-01
> 0.5
> total        :   1.6414479E-01
> %
>
> I don't understand...
> This is using p9p.
>
> Thanks for explanation!
> Ruda
>
>



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

* Re: [9fans] strange problem
  2010-07-19 12:14 ` roger peppe
@ 2010-07-19 12:24   ` Rudolf Sykora
  2010-07-19 12:50   ` erik quanstrom
  1 sibling, 0 replies; 4+ messages in thread
From: Rudolf Sykora @ 2010-07-19 12:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>  {for(i in 0.*) @{builtin cd $i; echo $i; grep total otdit| grep -v
> number}} >data
>
> should work.

works. thanks!
Ruda



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

* Re: [9fans] strange problem
  2010-07-19 12:14 ` roger peppe
  2010-07-19 12:24   ` Rudolf Sykora
@ 2010-07-19 12:50   ` erik quanstrom
  1 sibling, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2010-07-19 12:50 UTC (permalink / raw)
  To: 9fans

On Mon Jul 19 08:16:56 EDT 2010, rogpeppe@gmail.com wrote:
> that's because the cd function calls awd which prints some terminal
> control codes to change the window's idea of the current
> working directory. IMHO it should write to stderr,
> but it doesn't.

this is for p9p.  plan 9 doesn't have this problem.  it uses
device files instead.  but being p9p, it has to get along with
other unix programs that do send their terminal control
stuff to fd 1.  there's no sense fighting it.  and the same
problem would apply to fd 2, only less often.  plan 9
implements a correct solution.  it's unclear what to do
in p9p.  perhaps a partial solution (use a 3d file descriptor
for p9p programs) might be worth it, even if it does result
in less consistency and having to deal with 2 ways of getting
terminal information.

- erik



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

end of thread, other threads:[~2010-07-19 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 11:40 [9fans] strange problem Rudolf Sykora
2010-07-19 12:14 ` roger peppe
2010-07-19 12:24   ` Rudolf Sykora
2010-07-19 12:50   ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).