1. Getting rid of "Press Enter..." under Linux
Sorry if this gets posted twice, but I thought I posted this yesterday but
it never showed up!
Does anyone know how to get rid of the "Press Enter..." prompt when a
program finishes running under Linux?
I thought I remember reading the answer somewhere, but a search of the docs
and the message archives did not turn anything up.
Thanks for the help!
2. Re: Getting rid of "Press Enter..." under Linux
If the Eu program running under Linux adheres to the following
pre-requisites:
It does not prompt the user for *any* input
It does not include the string "Press Enter..." in *any* output
then you can use an "expect" script to run the program. The expect script
will run the Eu program and when the program prompts with "Press Enter..."
it will automagically send a return character which will then cause the
program to finish.
Example time!
Here is a Eu Linux program called "hello.exu":
-- hello world prog under linux
include file.e
printf(1, "Hello Andy", {})
abort(0)
Here is an expect script called "runhello":
#!/usr/bin/expect
spawn exu hello
expect {
"\n\nPress Enter...\r\n" {
send "\r"
}
eof {
exit 0
}
}
expect eof
exit 0
Make the runhello script executable:
chmod u+x runhello
Now run it:
./runhello
No interaction needed! You can even do:
./runhello >/tmp/hello.out
more /tmp/hello.out
Ok this is what one of my friends would call a "monster hack" but like a lot
of hacks it works
What would be better IMHO is a command line switch like:
exu -s hello
when -s would mean "suppress the Press Enter prompt at the end of
execution".
Regards,
Andy Cranston.
-----Original Message-----
From: Jamey [mailto:cribbsjg at EARTHLINK.NET]
Sent: 16 August 2000 13:15
To: EUPHORIA at LISTSERV.MUOHIO.EDU
Subject: Getting rid of "Press Enter..." under Linux
Sorry if this gets posted twice, but I thought I posted this yesterday but
it never showed up!
Does anyone know how to get rid of the "Press Enter..." prompt when a
program finishes running under Linux?
I thought I remember reading the answer somewhere, but a search of the docs
and the message archives did not turn anything up.
Thanks for the help!
3. Re: Getting rid of "Press Enter..." under Linux
Jamey writes:
> Does anyone know how to get rid of the "Press Enter..."
> prompt when a program finishes running under Linux?
Try calling free_console() in dll.e just before your
program terminates.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
4. Re: Getting rid of "Press Enter..." under Linux
Works like a charm.
Regards,
Andy Cranston.
PS: I'd like a HP-UX port some time soon too
-----Original Message-----
From: Robert Craig [mailto:rds at ATTCANADA.NET]
Sent: 16 August 2000 16:51
To: EUPHORIA at LISTSERV.MUOHIO.EDU
Subject: Re: Getting rid of "Press Enter..." under Linux
Jamey writes:
> Does anyone know how to get rid of the "Press Enter..."
> prompt when a program finishes running under Linux?
Try calling free_console() in dll.e just before your
program terminates.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
5. Re: Getting rid of "Press Enter..." under Linux
Robert,
Thanks! As Andy said, works great!
Andy, thank you for your helpful suggestion as well.
I have to say that, being a newbie, I am only just starting to realize the
"coolness" that is Euphoria.
I have dabbled in a lot of different languages (although I wouldn't call
myself an expert in any of them) and, though they all have neat features, it
is beginning to dawn on me how sequences make a lot of things incredibly
easy in Euphoria.
It's not perfect (just ask Mike the Spike!), but for what I want/need to do,
it fills a lot of needs.
Thanks to everyone on the list for the helpful info that gets posted
here...and a special thanks to Irv Mullins for answering some of my
questions personally.
Later.