OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to make executable script
toadatrix
post Mar 9 2004, 06:52 PM
Post #1





Group: Members
Posts: 72
Joined: 2-March 04
Member No.: 2,122



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.
Go to the top of the page
 
+Quote Post
boosalis
post Mar 9 2004, 07:12 PM
Post #2





Group: Members
Posts: 78
Joined: 28-January 04
From: clovis CA USA
Member No.: 1,580



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.
Go to the top of the page
 
+Quote Post
lardman
post Mar 10 2004, 02:24 AM
Post #3





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
pakman
post Mar 10 2004, 09:27 AM
Post #4





Group: Members
Posts: 41
Joined: 8-March 04
From: UK
Member No.: 2,204



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 1st November 2014 - 03:11 AM