When you double-click a bash script, Ubuntu asks if the user wants to Display, Run, or Run In Terminal…
Is there a way within the script to determine if the user chose “Run In Terminal”?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Strictly speaking, you can’t tell whether the user chose “Run In Terminal” after clicking on the script, or fired up a terminal and ran the script from there. But the commands below should help you, especially
[ -t 2 ].