🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Michael Elbel Fri, 01 Sep 1989 13:41
weird bash behavior
#526
Author: Michael Elbel
Date: Fri, 01 Sep 1989 13:41
47 lines
1502 bytes
I have two problems with bash, maybe they are not local to our systems here

1.

Try the following thing:

foo() {
	read zoom
	read boom < /dev/tty
	echo $zoom $boom
}

As long as you run it without input redirection, everything is fine.
But if you do something like

cat >/tmp/bar
frob
net
^D

giving you a two line file and feed that into 'foo'

foo </tmp/bar

I now expect to be able to write something in variable $boom from my keyboard
(/bin/sh accepts it). But nope, bash gives me the line
frob net
and quits.



2.

There seems to be no way to cancel the actual input line with 'intr' as in 
sh or ksh. This is especially annoying if you are some levels deep in
'if', 'while' and so on clauses and want to get out, or you have hit some 
unknown quoting character(s) bash keeps on prompting $PS2 till you
complete the syntax (or loose your mind).

Has anybody ran into the same problems ?

		Michael

#include <usual_excuse_about_bad_english>
--
Michael Elbel, PCS Computer Systeme, Muenchen
(me@dude.PCS.COM for the World), (me@dude.PCS.DE for Europe)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads