scripting
How do i create a basic script file. I want to be able to click on an icon on the desktop and be able to run a few linux commands from within the prompt.. Kinda like a BATCH file..
Any ideas? I'm sure its easy... when you know how. |
You create it in your favorite text editor, like Vim. See here --> http://tldp.org/LDP/abs/html/abs-guide.html. Don't worry that it says "Advanced."
|
Here's another good tutorial: http://rute.2038bug.com/index.html.gz
|
Quote:
Once that's working the second part is how to create an icon on the desktop that will open a terminal, run the script and leave the terminal open (assuming you want to see the ouput from the script). This second part is harder and the specifics depend on which Desktop, which Terminal Emulator and which scripting language you are using. Which are you using? There are many scripting languages; the "obvious" choice is bash. |
Quote:
What's your take? |
Quote:
|
Sorry for the delay in reply, I hope you can still answer this for me
terminal: GNOME Terminal 2.26.3.1 desktop configuration file (application/x-desktop) This is the file type (Shortcut from the desktop) All I did was create a shortcut to run a command.. typed in the command as if I've opened a terminal. The command runs, than Gone. I'm not running a script per say... Should I be? |
In my humble opinion, one step at a time:
The tutorials above can help you with the first step, all you need is a text editor, either a graphic one or a command line text-based one, it's irrelevant as long as it can save the file as plain text. For the second step you will want to check the man page for chmod, you can also use graphical tools. Most graphical file explorers will allow you to set the permissions of a given file. The third step is just a matter of experimenting on your desktop to create a link to the script, most desktops show some kind of "Run on a terminal" option, which is useful for these cases. If not, it still can be done. But let's worry about that later. |
All times are GMT -5. The time now is 01:30 AM. |