identify problems when run as Unix CL/ECL script
Doug Mink wrote on Sep 07, 2006
We're having strange interactivity problems with identify when we run it from
a CL script on the Unix command line. All of the single-character cursor
commands work, except that 'm' doesn't prompt for a wavelength. Rather,
it prompts and immediately responds by itself with garbage. A similar situation
occurs when you type 'q' and aren't saving results to a database file automatically.
The prompt asking whether you want to save is automatically responded to and
you're back on the command line. 'm' works fine inside IRAF, but it fails this way
on both Solaris and Linux, on xterm, gterm, and tek4014 terminals. Does anyone
have any ideas what could be going wrong? It looks to me like a CR or LF is
getting inserted somewhere in the software.
a CL script on the Unix command line. All of the single-character cursor
commands work, except that 'm' doesn't prompt for a wavelength. Rather,
it prompts and immediately responds by itself with garbage. A similar situation
occurs when you type 'q' and aren't saving results to a database file automatically.
The prompt asking whether you want to save is automatically responded to and
you're back on the command line. 'm' works fine inside IRAF, but it fails this way
on both Solaris and Linux, on xterm, gterm, and tek4014 terminals. Does anyone
have any ideas what could be going wrong? It looks to me like a CR or LF is
getting inserted somewhere in the software.
Mike Fitzpatrick wrote on Sep 07, 2006
Hi Doug,
The ECL uses the readline interface which basically puts the terminal into raw mode. Additionally, when a script is run as a #!cl task from the unix commandline the behavior is the same as if you'd executed it as "cl < script.cl", i.e. all input is redirected from the script itself and so the response to the 'm' keystroke prompt is essentially the next line of the script (hence the garbage).
You can keep the error-handling aspects of the ECL while disabling the readline interface by doing
(note the space!) within your script. Let me know if you still have problems.
Cheers,
-Mike
The ECL uses the readline interface which basically puts the terminal into raw mode. Additionally, when a script is run as a #!cl task from the unix commandline the behavior is the same as if you'd executed it as "cl < script.cl", i.e. all input is redirected from the script itself and so the response to the 'm' keystroke prompt is essentially the next line of the script (hence the garbage).
You can keep the error-handling aspects of the ECL while disabling the readline interface by doing
cl.ehinit = cl.ehinit // " noreadline"(note the space!) within your script. Let me know if you still have problems.
Cheers,
-Mike
Last post on Sep 07, 2006