![]() |
how to make/save a script?
I'm trying to get the BT PAN workaround done. I have putty installed and have successfully ssh'd into my n800. now I need to copy fanoush's script into my n800 so I can execute it. I saw someone mentioning text editors (maemo editor? Vim? Vi?), I'm assuming I need to use the editor to make/save the script onto my n800? how do I open the editor via ssh on my laptop and put the script in there?
EDIT: after some searching I found and installed VIM on maemo downloads. I typed vim btup type i copied and pasted the script hit the esc key then type :wq however, when I try to bring it up on the n800 as root (i typed /home/user/./btup) it says /bin/sh: ./btup: permission denied am i on the right track? |
Re: how to make/save a script?
if you have saved btup in the home directory then you need to run:
Quote:
Quote:
|
Re: how to make/save a script?
as Rick said. To elaborate: What 'chmod u+x' does (for some scripts it might be safer to use 'a+x', so that not only the owner of the file but anyone - including the root user - can execute it) is to set the 'executable' bit on the shell script file, so that it can be executed. Alternatively, the shell 'sh' can be executed, with the file name as parameter (the 'sh' program is in the default PATH, so no explicit path (./ in the btup case) is needed, and it already has the 'x' bit set)
(That was today's little generic Unix/Linux lession..) |
Re: how to make/save a script?
thanks, guys
another question: I want to execute the following two commands in a separate script: Code:
#pand --role PANU --service NAP --connect XX:XX:XX:XX:XX:XX --nodetach can I just copy those into VIM using the above method, and execute? or is there more to it then that? |
Re: how to make/save a script?
You copy them into a file (without the '#'), and then you insert the following line as the very first line in the file (including the '#'):
#!/bin/sh Then do chmod a+x filename (that is the name of the file you chose) and you can execute it with ./filename (if it's in the current directory), or with /home/user/filename (or any other absolute path necessary) |
All times are GMT. The time now is 19:16. |
vBulletin® Version 3.8.8