Subject: stdin and sushi
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 03/24/2002 16:37:15
Hi!

I'm trying to create sushi menus for etcupdate but seems like I can't read
from stdin in the script. My current /usr/share/sushi/system/etcupdate/script
looks like this

	#!/bin/sh
	#
	# $NetBSD$
	#
	PATH=/usr/pkg/sbin:/usr/pkg/bin:/sbin:/usr/sbin:/bin:/usr/bin
	etcupdate

and the trouble maker in /usr/sbin/etcupdate seems to be the "read ANSWER"
line. How can I read from stdin(=keyboard) in sh scripts launched by sushi?
Or is sushi "stealing" stdin? (I haven't looked at the code yet)

Right now I end up killing the process as there's no other way of
getting out...

	ROOT pc1:~> ps axw | grep sushi
	6429 p2 S+   0:00.03 sushi etcupdate
	6431 p2 S+   0:00.00 sushi etcupdate
	6430 p6 Ss+  0:00.00 /bin/sh /usr/share/sushi/system/etcupdate/script
	ROOT pc1:~> kill 6430

If you feel like helping me out:

	# cd /tmp
	# ftp http://www.piuha.net/~martti/tmp/sushi.tgz
	# cd /usr/src && tar xzvf /tmp/sushi.tgz

Martti

---
Martti Kuparinen <martti.kuparinen@iki.fi>      NetBSD - No media hype
http://www.iki.fi/~kuparine/                    http://www.netbsd.org/