OESF Portables Forum

Everything Else => Desktop Operating Systems Issues => Zaurus General Forums => Archived Forums => Linux Issues => Topic started by: toadatrix on March 09, 2004, 09:52:43 pm

Title: How to make executable script
Post by: toadatrix on March 09, 2004, 09:52:43 pm
I am a linux newbie.  How do I go about taking a text file containg the following and making this into an executable script:

cd /etc/pcmcia
mv wlan-ng.conf .wlan-ng.conf
mv .hermes.conf hermes.conf
/etc/rc.d/init.d/pcmcia restart

Also, once I have that as an executable script file what directory folder should it be stored in?  Thanks.
Title: How to make executable script
Post by: boosalis on March 09, 2004, 10:12:16 pm
This might be a good start:
Create a file called myscript.sh with the following:

#!/usr/bin/sh        // or what ever shelll is on Zaurus
then your commands below this
.....


give file executable privledges
chmod 755 myscript.sh

But the problem with your script is that those actions can only be done as root.  You can store it in any directory you want, \"/home/zaurus\" would be a good one. since this is the directory you land in when a terminal window is fired up.

Mabye in the script you could have a \"su\" before your commands, since the root user has not password.

Sorry I can\'t offer more help.  I hate scripts and try to do as little of them as I can.
Title: How to make executable script
Post by: lardman on March 10, 2004, 05:24:45 am
Make sure you don\'t use the Sharp text editor as it will mess up the line feeds (use vi instead :twisted: ) . If you do use this you\'ll need to run dos2unix (from killefiz) on the file to make it usable.


Si
Title: How to make executable script
Post by: pakman on March 10, 2004, 12:27:55 pm
Quote
But the problem with your script is that those actions can only be done as root. You can store it in any directory you want, \"/home/zaurus\" would be a good one. since this is the directory you land in when a terminal window is fired up.

Mabye in the script you could have a \"su\" before your commands, since the root user has not password.

A better solution is to use \"sudo\". Go to the downloads section and type it in the search box.

Regards,
P.