9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] <> operator
@ 2009-09-17 12:45 Rudolf Sykora
  2009-09-22 17:06 ` sqweek
  0 siblings, 1 reply; 2+ messages in thread
From: Rudolf Sykora @ 2009-09-17 12:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

is the <> operator a feature only of native plan 9?
It doesn't seem to work for me in p9p...
Is the right solution then, instead of

program <> file

write

program < file > file_tmp
mv file_tmp file

?
Thanks
Ruda



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

* Re: [9fans] <> operator
  2009-09-17 12:45 [9fans] <> operator Rudolf Sykora
@ 2009-09-22 17:06 ` sqweek
  0 siblings, 0 replies; 2+ messages in thread
From: sqweek @ 2009-09-22 17:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

2009/9/17 Rudolf Sykora <rudolf.sykora@gmail.com>:
> Hello,
>
> is the <> operator a feature only of native plan 9?
> It doesn't seem to work for me in p9p...
> Is the right solution then, instead of
>
> program <> file
>
> write
>
> program < file > file_tmp
> mv file_tmp file

 It works fine in p9p, however it doesn't do what you want it to do.
<> opens a file for reading and writing, on a single file descriptor
(default 0 iirc). You can then duplicate that to stdout (>[1=0]) so
the process is reading and writing to the same file, but I'd be very
surprised if that satisfies your requirements.
 The tmp file trick is the most reliable idiom for this task, as far
as I'm aware.
-sqweek



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

end of thread, other threads:[~2009-09-22 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-17 12:45 [9fans] <> operator Rudolf Sykora
2009-09-22 17:06 ` sqweek

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).