Help with writing a script

RichStevenson

Member
Joined
Nov 11, 2009
Messages
475
Reaction score
0
Location
Medina, OH
Trying to write a script and am having no luck getting it to run the way I want. So I've started from the very beginning and am now trying to write a simple Hello World script. Here's what I have:

#!/system/bin/sh
echo Hello World

Named the file vpndns and saved it to \system\xbin

\system\xbin is in my path. Verified with the set command.

When I run it as:
vpndns
I get Permission Denied so I cd to \system\xbin and chmod 755 vpndns.

Now when I run it I get "not found".
If I change to the \system\xbin\ I receive the same error. But if I run it as:
sh vpndns
it runs.

My intent was to run it without the 'sh' from any dir. Can anyone shed some light on what I'm doing wrong?
Thanks
 

skourg3

Member
Joined
Dec 14, 2009
Messages
69
Reaction score
0
Yep. You're missing quotes around your Hello World. I just threw one together. Making sure system is mounted rw, then I did

cd /system/xbin
touch hworld
echo "#!/system/bin/sh" > hworld
echo "echo \"Hello World\"" >> hworld
hworld

output...
/system/sbin #hworld
hworld
Hello World

I did it this way because I'm not sure how to use the busybox version of vi (through adb, anyway), and I was too lazy to see if there was another editor present; you definitely don't need to write a script using redirects like that.
 

defleopard98

New Member
Joined
Dec 25, 2009
Messages
6
Reaction score
0
Location
Rolling Meadows, IL
I don't think you need the quotes.

Are you using Windows? The error might lie in the line ending (newline vs carriage return-newline)
You can try using an editor supporting unix line endings (i think notepad++ does) or typing it on your phone.
 
S

soniat

Guest
In writing a good academic work the writer should clearly identify the thesis of the study. This will help the writer in organizing the paper and thus the thesis statement determines ho the paper would look like. The statement should clearly state the reason for carrying out the study and the positive impact of the study. The last week i have planned to buy term papers online due to my lack of academic writing skills. The thesis statement should be brief and should include the theme of the paper.
 
Top