Active Topics

 


Reply
Thread Tools
Posts: 9 | Thanked: 1 time | Joined on Aug 2007
#1
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?

Last edited by daveymark; 2007-08-31 at 15:50.
 
rcull's Avatar
Posts: 299 | Thanked: 168 times | Joined on Jun 2006 @ Wales UK
#2
if you have saved btup in the home directory then you need to run:

chmod u+x ./btup
another way would be to run

sh ./btup
Rick
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#3
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..)
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 9 | Thanked: 1 time | Joined on Aug 2007
#4
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

#udhcpc -i bnep0

can I just copy those into VIM using the above method, and execute? or is there more to it then that?
 

The Following User Says Thank You to daveymark For This Useful Post:
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#5
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)
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:51.