9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 'rc' question: how to read a line ?
@ 2003-12-18 16:49 Wladimir Mutel
  2003-12-18 17:06 ` mirtchov
  0 siblings, 1 reply; 5+ messages in thread
From: Wladimir Mutel @ 2003-12-18 16:49 UTC (permalink / raw)
  To: 9fans

	Hi,

	I use 'rc' shell ported to Unix (Linux/AIX/HPUX).
	In most shells (including 'es' shell modeled after 'rc'),
	there is 'read' builtin command, to read a line from stdin and assign
	its words to one or more variables. But there is no such command in
	'rc'. How could I replace it ? 'head -n1' does not work as expected in
	most Unixes, as its reads are buffered and often eat more then one
	line from stdin. Should I write my own little hack in C ? :>

	Thank you in advance for your replies.


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

* Re: [9fans] 'rc' question: how to read a line ?
  2003-12-18 16:49 [9fans] 'rc' question: how to read a line ? Wladimir Mutel
@ 2003-12-18 17:06 ` mirtchov
  2003-12-18 17:13   ` mirtchov
  0 siblings, 1 reply; 5+ messages in thread
From: mirtchov @ 2003-12-18 17:06 UTC (permalink / raw)
  To: 9fans

read(1) in Plan 9 is a binary -- /sys/src/cmd/read.c

it can server as an example, perhaps?



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

* Re: [9fans] 'rc' question: how to read a line ?
  2003-12-18 17:06 ` mirtchov
@ 2003-12-18 17:13   ` mirtchov
  2003-12-19  5:04     ` boyd, rounin
  0 siblings, 1 reply; 5+ messages in thread
From: mirtchov @ 2003-12-18 17:13 UTC (permalink / raw)
  To: 9fans

> it can server as an example, perhaps?

for some reason I keep writing 'server' instead of 'serve'.  my
fingers just keep hitting the last 'r'...



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

* Re: [9fans] 'rc' question: how to read a line ?
  2003-12-18 17:13   ` mirtchov
@ 2003-12-19  5:04     ` boyd, rounin
  0 siblings, 0 replies; 5+ messages in thread
From: boyd, rounin @ 2003-12-19  5:04 UTC (permalink / raw)
  To: 9fans

> for some reason I keep writing 'server' instead of 'serve'.  my
> fingers just keep hitting the last 'r'...

maybe you mean 'sever'?

    http://www.hyperdictionary.com/dictionary/sever



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

* Re: [9fans] 'rc' question: how to read a line ?
@ 2003-12-18 17:11 Richard C Bilson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard C Bilson @ 2003-12-18 17:11 UTC (permalink / raw)
  To: 9fans

> read(1) in Plan 9 is a binary -- /sys/src/cmd/read.c
>
> it can server as an example, perhaps?

The archives from earlier this year have an equivalent for UNIX-type
systems.


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

end of thread, other threads:[~2003-12-19  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-18 16:49 [9fans] 'rc' question: how to read a line ? Wladimir Mutel
2003-12-18 17:06 ` mirtchov
2003-12-18 17:13   ` mirtchov
2003-12-19  5:04     ` boyd, rounin
2003-12-18 17:11 Richard C Bilson

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