Script to call Terminal and execute Terminal commands?

Asked by coljohnhannibalsmith

I have managed to setup a Sony Ericsson GC89, which has no Linux support to connect to "T-Mobile" and I would like to write a script to do nothing other than call Terminal and execute the following commands:

"call pppd tmobile"

I suspect I simply need to write a text file; but I need to pass the above referenced commands to Terminal. I suspect this could also be accomplished by setting the file extension to something such as ".run."

Can anyone point me in the right direction?

Thanks, John

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
coljohnhannibalsmith
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) said :
#1

Hello,

You can create a text file containing :

#!/bin/bash
call pppd tmobile

Then make it executable : chmod +x name_of_script

Once it's done, you can call it by: cd /path/to/script/folder/ && ./script_name

Revision history for this message
coljohnhannibalsmith (john-wakefield2) said :
#2

Jerome,

Thank you for your response. I edited my script as you suggested as follows:

#!/bin/bash
pppd call tmobile

When I saved it the icon changed to a "Shell Script" icon; however when I clicked on it it asked me if I wanted to "Run it in Terminal," "Display it," or "Run it." I would like to just have it run in terminal without being asked everytime.

Is there a way to do this?

Thanks, John

Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) said :
#3

I don't really know how to do this with a script, however you can do this easily by creating a launcher on the desktop or on a panel with "call pppd tmobile" as command.

Revision history for this message
coljohnhannibalsmith (john-wakefield2) said :
#4

I've tried the launcher method and it seems to work well.

Thanks, John