Scripts

Soldato
Joined
5 Jul 2003
Posts
16,206
Location
Atlanta, USA
Hi.
Is there a way i can make the linux equilivent of MS DOS batch files?
Theres about 6 or so terminal commands that i would like to have in executable form.

How would i go about doing this?

Thanks in advance all. :)
 
I cant find nout.
The only thing i can find, which is to add:
Code:
#!/bin/bash
To the beginning of my code

Im saving the following:
Code:
#!/bin/bash
aticonfig --list-powerstates
To a file called 'ATI_PowerStates_Information.sh'
I then run the following in terminal:
Code:
chmod +x ATI_PowerStates_Information.sh
And nothing happens in the terminal. So i goto the file itself, double click, and all it does it open a new terminal window?

Ideas?
 
Beepcake said:
Just run vi (or your favourite editor) and make a file like this:

#!/bin/bash
<your commands here>

Then save it and do chmod +x <filename>, then just ./<filename> to run it.
Which is pretty much what i managed to find, but it doesnt work.
I want it so that they are executable from icons. :)
 
riven said:
Do you want it to open a terminal and then run that command and list the output in the terminal?
It doesnt 'list' anything at all though.

Your urxvt command doesnt do nout either. :(

The way i understand to do it, is to put my previously listed code into a txt editor, save as whatever.sh, then run that chmod command, which'll make it executable, but it doesnt work!?
 
Ok then.
Hows about everything you two have suggested in what i like to call, English. ;)
Im not vastly experianced with Ubuntu as ive just started using it, so can you two list EVERY command that i have to put in, rarther than just loose descriptions of what i need to do.
Thanks. FYI, the username on the system is 'boomam'.

Thanks.
 
BillytheImpaler said:
Alright, we'll use the terminal and cd command then describe where the file is. In this example the script is called scripty.sh and it is located in /home/boomam/scripts.
Open up the terminal and type
Code:
cd /home/boomam/scripts/
Then we're going to make the script executable. Type
Code:
chmod +x scripty.sh
Now you can execute the script with
Code:
./scripty.sh

Does that work? Does the script execute in the terminal window?
Yes, that works.

How do i get it so that i can have an icon somewhere, like a folder on my desktop, so i can just double click to get that command to display and run?
 
Back
Top Bottom