Results 1 to 7 of 7
I have just installed an OBDII automobile code reader to get diagnostic codes. It is a python program run from the command line as root.
Since I only will use ...
- 12-27-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 23
Shell Script to Run Terminal as Root and cd and Execute a Command
I have just installed an OBDII automobile code reader to get diagnostic codes. It is a python program run from the command line as root.
Since I only will use this occasionally I would like to make a shell script to add to the panel so I don't have to remember the path file name and command to start it.
I know that I can open the terminal with this command:
/usr/bin/gnome-terminal
The other commands if I could pass them to the terminal would be:
sudo
password
cd /tmp/obdpy/pyobd-0.9/
python wxgui.py
Is there a way to do this?
Thanks
- 12-27-2007 #2Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
Make a launcher the executes this command:
and see if it is what you are looking for.Code:gnome-terminal -x "sudo python /tmp/obdpy/pyobd-0.9/wxgui.py"
You can also configure sudo not to ask for your password.--Erik
- 12-27-2007 #3Just Joined!
- Join Date
- Jan 2007
- Posts
- 23
I get a "There was an error creating the child process" error.
I see it actually opens the terminal twice.
- 12-27-2007 #4Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
maybe try to make it execute only:
Code:sudo python /tmp/obdpy/pyobd-0.9/wxgui.py
--Erik
- 12-27-2007 #5Just Joined!
- Join Date
- Jan 2007
- Posts
- 23
Nothing happens when I try that.
I did put the first line directly into the application launcher and it only brings up one terminal with the error mentioned above. Also there is no command prompt on the terminal screen after I clear the error message.
Is there a log file somewhere for the gnome terminal?
- 12-27-2007 #6Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
hmm, sorry I'm not sure. my only other thought would be to launch gnome-terminal with sudo and then just launch the command after the -x:
also make sure that is indeed the path to the file, the /tmp makes me worried.Code:sudo gnome-terminal -x "python /tmp/obdpy/pyobd-0.9/wxgui.py"
Good luck.--Erik
- 12-27-2007 #7Just Joined!
- Join Date
- Jan 2007
- Posts
- 23
Thanks,
That didn't work either. I also tried just sudo gnome-terminal to see if that would bring up the terminal and it didn't.


Reply With Quote