In article <v1dg7f$3ake3$
[email protected]>, sjack <
[email protected]> wrote: >Using 'xargs' with FigForth to handle multi-lines of pipe input:
:) cat << EOF | xargs myfig "20 constant A" "2 constant B"
cr
A B
tuck * +
'." --> "' .
bye
EOF
42 :)
I recall an old DOS Forth had -FILE and -TERMINAL options where
-FILE option was used for piped input afterwich -TERMINAL would
switch the Forth back to terminal input.
On Linux using Readline allows direct piped input but I prefer
just using xargs for piped input and not altering termio.
( With termio's raw mode "Ok" is able to be placed on the line of
the last input; with Readline the "Ok" falls on the next line due
to Readline echoing newline.)
You can use stdin all the time, in linux, the trick is to use
READ-FILE throughout. That handles the rubout key for you
("backspace").
For KEY I switch the terminal by TERMIO temporarily, same for
KEY? .
Linux provides you with the input editing facilities, that you have
used in your shell and even a command history,
if you do
rlwrap forth
--
me
Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat purring. - the Wise from Antrim -
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)