PDA

View Full Version : how to install scripts? noobie question?


nielsvg
2010-03-06, 15:02
hello,

i'm trying to understand x-terminal and i want to cleanup my rootfs memory with help of the wiki on the site:

http://wiki.maemo.org/Free_up_rootfs_space

in this wiki they say:

This script will move some unnecessary files on rootfs to /home/opt/ to free up space on rootfs.

First, create a file, move-to-opt.sh for example, containing this script:


But with what program do i create this file? i tried it in notes and then saved it under .sh but it was still a note and offcourse it didnt work in x-terminal?

can someone please help me understeand scripts?

b666m
2010-03-06, 15:20
But with what program do i create this file? i tried it in notes and then saved it under .sh but it was still a note and offcourse it didnt work in x-terminal?

for example:
http://notepad-plus.sourceforge.net/de/site.htm
:)

nielsvg
2010-03-06, 15:24
for example:
http://notepad-plus.sourceforge.net/de/site.htm
:)

maybe an english site?

i only understand sturm der liebe:)

b666m
2010-03-06, 15:30
maybe an english site?

i only understand sturm der liebe:)

oh, sorry... xD
http://notepad-plus.sourceforge.net/uk/site.htm

(you just had to change "de" to "uk" ^^)

nielsvg
2010-03-06, 15:31
oh, sorry... xD
http://notepad-plus.sourceforge.net/uk/site.htm

(you just had to change "de" to "uk" ^^)

hehehe i didnt seen that:D thx mate

nielsvg
2010-03-06, 15:32
so i have to install this on my pc and make the script there and then transfer it to n900?

b666m
2010-03-06, 15:45
so i have to install this on my pc and make the script there and then transfer it to n900?

yap.
you could even just use the editor or wordpad but the syntax highlighting is very comfortable. :)
(especially if you want to understand what the script is doing and how it is doing)

copy&paste it. save it with .sh extension. copy it on your n900. open xterm. get root rights (install rootsh and type "sudo gainroot") make it executable with "chmod +x bla.sh" and then just run it with ". bla.sh" or "sh bla.sh".

BUT: please be aware... if you don't know what the script is doing exactly.. it could lead to some problems... if not right now - then maybe in the futuere (next update or so)

nielsvg
2010-03-06, 15:57
yap.
you could even just use the editor or wordpad but the syntax highlighting is very comfortable. :)
(especially if you want to understand what the script is doing and how it is doing)

copy&paste it. save it with .sh extension. copy it on your n900. open xterm. get root rights (install rootsh and type "sudo gainroot") make it executable with "chmod +x bla.sh" and then just run it with ". bla.sh" or "sh bla.sh".

BUT: please be aware... if you don't know what the script is doing exactly.. it could lead to some problems... if not right now - then maybe in the futuere (next update or so)


thanks i will try this. I know it could lead to problems but there is a wiki that i can use so normally nothing can go wrong???

b666m
2010-03-06, 16:27
thanks i will try this. I know it could lead to problems but there is a wiki that i can use so normally nothing can go wrong???

it's an open wiki.
anybody can write in it.
nasty people could even abuse this fact.

nielsvg
2010-03-07, 13:35
i made it with the program notepad++ and i transfer it to my phone in documents and then i type in terminal after rootacces: chmod +x move-opt-sh and then it says there is no such file with this name???

can anyone help?

b666m
2010-03-07, 14:39
i made it with the program notepad++ and i transfer it to my phone in documents and then i type in terminal after rootacces: chmod +x move-opt-sh and then it says there is no such file with this name???

can anyone help?

you have to "cd" into the directory where you stored the file first or write the full path in the command.

three examples when you copied the file in the documents directory via usb:

relative:
(when you open up xterm you're in /home/user/)
chmod +x MyDocs/.documents/move-opt.sh

absolute:
chmod +x /home/user/MyDocs/.documents/move-opt.sh

or first cd into the right directory:
cd MyDocs/.documents
chmod +x move-opt.sh

maybe you should learn how to get along with the terminal first before you do something big like moving system files around and symlinking them automatically....

nielsvg
2010-03-07, 15:32
you have to "cd" into the directory where you stored the file first or write the full path in the command.

three examples when you copied the file in the documents directory via usb:

relative:
(when you open up xterm you're in /home/user/)
chmod +x MyDocs/.documents/move-opt.sh

absolute:
chmod +x /home/user/MyDocs/.documents/move-opt.sh

or first cd into the right directory:
cd MyDocs/.documents
chmod +x move-opt.sh

maybe you should learn how to get along with the terminal first before you do something big like moving system files around and symlinking them automatically....

i saved the file on my phone in the file manager underr N900 and then documents

so when i put in the code in x-terminal: cd MyDocs or cd MyDocs/documents it stil keep saying cant cd to mydocs? and i'm in root access?

b666m
2010-03-07, 16:03
i saved the file on my phone in the file manager underr N900 and then documents

so when i put in the code in x-terminal: cd MyDocs or cd MyDocs/documents it stil keep saying cant cd to mydocs? and i'm in root access?

unplug the usb first. ^^
and the command line is case sensitive.

nielsvg
2010-03-07, 16:07
unplug the usb first. ^^
and the command line is case sensitive.

he wasnt connected??? i disconnect the phone and tried it but doesnt work

b666m
2010-03-07, 16:09
he wasnt connected??? i disconnect the phone and tried it but doesnt work

huh?
then "cd MyDocs/.documents" should work.

and pay attention to the . before documents.

nielsvg
2010-03-07, 20:43
huh?
then "cd MyDocs/.documents" should work.

and pay attention to the . before documents.

ok now it works but then when i use chmod i don't get confirmation that the script is executable and then when i try ./move code it sais permission denied

b666m
2010-03-07, 21:02
ok now it works but then when i use chmod i don't get confirmation that the script is executable and then when i try ./move code it sais permission denied

try "sh move-opt.sh"

nielsvg
2010-03-07, 21:10
try "sh move-opt.sh"

ok thanks. i dont know why but now i only have 10mb free?