Add option to execute a script
lethal-guitar opened this issue · 4 comments
Make it possible to pass a .sh file in addition to a text file, and show an additional "Execute" button. When pressed, the script is run and it's output shown in the text area.
how do you use the yesno option? if I use the -y option, the yes / no choices appear, but what is the syntax to manage the commands to be executed depending on the option chosen? i'm using shell bash
Hi @RavenKilit , the chosen option is indicated by the program's exit code. If the yes button is pressed, the exit code is set to 21, otherwise to 0. To check the last program's exit code in bash, use $?. See https://bencane.com/2014/09/02/understanding-exit-codes-and-how-to-use-them-in-bash-scripts/ for more info
thank you very much @lethal-guitar , it works perfectly!!!!
This is implemented as of 3e95de9