2

I have a script to open a terminal and run a command on it:

#!/bin/bash
export DISPLAY=:0.0
/usr/bin/gnome-terminal -e '/home/me/bin/application --option a --option b --debug'

However, the gnome-terminal appears in a blink and then this disappears when the script is executed for the startup application service. I want to leave this terminal open because this gives basic information in the debugging mode. When I run this basic script in a terminal, all is fine. This only fails as this is executed for the startup application service.

Any suggestions?

Update

OK, I edited the profile preference in gnome-terminal not to close the terminal, once the program has been executed (profile preferences->Title and Commands -> in When command exits->Hold the terminal open). I could read a message in the terminal that says during the execution of the script hasn't been found certain python libraries. By the way, the program that I want to run is a python script. Obviously, at the beginning of the python script, I put:

#!/usr/bin/env python

Even so, It is not working. I usually put certain environmental variables in the ~/.bashrc script to be called when a gnome-terminal is open. How can I source the ~/.bashrc script using /bin/sh?

0

You could achieve this, I believe, with the "sleep" command: sleep [number] (essentially makes the terminal wait for however many seconds you put in the number field... i.e. sleep 100 would make it wait 100 seconds before closing. You could quit the terminal at any time, as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.