Hello.
I have some kind of script that are started from a desktop file.
Is it possible to determine in the script during runtime if the checkbox ‘Run in terminal’ in the advance option is checked or not.
If the checkbox is not check i have to skip some interactive messages.
What likely matters, is whether the command (or script, or whatever) is running on a terminal. How it got to be running on the terminal (whether the box is checked or it was manually started at a command line) is unlikely to be important.
In a shell script you can test:
if -t 1 ; then
stuff for terminal
else
stuff for non-terminal
fi
This is testing file descriptor 1, usually stdout. You can instead use 0 (for stdin) or 2 (for stderr) depending on what you are wanting to test.
Is it possible to determine in the script during runtime if the checkbox ‘Run in terminal’ in the advance option is checked or not.
If the checkbox is not check i have to skip some interactive messages.
**If the checkbox is not check i have to skip some interactive messages.
**
Any other tips or tricks are welcome.