PDA

View Full Version : How do I make a skript?



Noob
03-14-2005, 10:12 AM
After booting I have to type in several commands to be executed as root. I'd like to make this a bit easier via script, but I don't know how :oops:

By the way, what means shell, bash etc?

OErjan
03-14-2005, 05:03 PM
bash is a shell.
and a shell (there are several zsh, ch, csh, ash to name a few) is what interprets your typed comands and pass them down to the next level of operation.
by the way, what comands are they, this might make helping you easyer.

Noob
03-14-2005, 07:06 PM
The comands are like
wlanctl-ng wlan0 lnxreq...
ifconfig wlan0 ...
route gw...

etc.

I put the lines in a file, name the ending .sh and mark it executable. When I try to run the script nothing happens. I have to copy the lines and paste them into the console, after switching to root.

By the way... How can I access another resource over the network?

Noob
03-14-2005, 07:06 PM
The comands are like
wlanctl-ng wlan0 lnxreq...
ifconfig wlan0 ...
route gw...

etc.

I put the lines in a file, name the ending .sh and marked it executable. When I try to run the script nothing happens. I have to copy the lines and paste them into the console, after switching to root.

By the way... How can I access another resource over the network?

eon
03-17-2005, 02:17 AM
This was the best, and lightest tutorial I could find ( I even bookmarked for myself )

http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/unixscripting/unixscripting.html

The 3rd paragraph under the topic "Shell Scripting" may have the answer you're looking for.
You need to specify the shell (interpreter) in the 1st line of the script.