Update:
I canβt check it right now, but take a look at the ?menu and run the gui window.
I'm not sure if this will work, but it differs in that a mouse response is required.
original answer:
According to the documentation on ?readline :
This can only be used in an interactive session.
..
In non-interactive use, the result looks as if the response was RETURN, and the value is "".
If you just wait for one piece of information and donβt know this information before the script starts executing (presumably, you need to make a decision that depends on the results of the earlier script), then one alternative is to simply split your script into three parts:
- everything to the point of decision.
- interactive script that requests input
- everything after the decision point.
And just connect the three together, having the first end, invoking the second in an interactive session. Then make the second end by calling the third.
source share