![]() |
Save scripts.. What extension do i need?
I hope someone can give me a few good pointers.
I have googled the standart shell commands. ls is the is the counterpart to dir and so on. Now, in dos i can write batch files, with would have the ending .bat so my pc knows what to do with them. While searching the web, i read it would be .sh in linux, but it didn't work for me. What file extension do i need for linux? To be sure, there are no file links, I tried notesm, leafpad and PyTKEditor for writing the scripts. Also, on some messed up pc's i have to tell windows, that .bat files are executet in the comandline.. Do i have to make such a conection on my N800 too? I have installed xterm and i can access root with "sudo gainroot" .. Haven't done much more until know, because i want to understand what i do, before i messed up. Thanks for your help, Eismaus |
Re: Save scripts.. What extension do i need?
The extension doesn't matter (although .sh is sometimes used).
What is missing is the correct permission on the file, you need to do something like this: chmod ugo+x somescript meaning set eXecutable attribute for the file's User,Group and Other (i.e. everyone) users. The other attributes are r=Read and w=Write, which can all be set independently for the User, Group and 'Other'. Additionally, the filesystem that holds the file needs to be executable - the memory card is not, so that command would not help for files stored there. One other pitfall if you're used to DOS, the current directory is NOT part of the path searched for executables (for security reasons). So you need to specify a path to run the script even if it's in the current directory. It can be a relative path, so this will do: ./somescript |
Re: Save scripts.. What extension do i need?
In Linux scripts, the first line tells the script what interpreter to use, using a special "#!" syntax. To the unaware, it looks like a comment line.
On the n800 etc, a script using sh would start like this: #!/bin/sh |
Re: Save scripts.. What extension do i need?
Quote:
|
Re: Save scripts.. What extension do i need?
Quote:
I am using linuxcommand.org's reference to brush up on shell commands etc: online version downloadable version |
Re: Save scripts.. What extension do i need?
@ichmoimeyo Thanks for the links, i downloaded the file and i'll read it on my way to work tomorrow.
@dormant I had #!/bin/bash because my live-cd used this. I corrected it. @paulh & @TA-t3 So i have to make the file executable first. And i could not save the script on the memory card. Ok, this i understand. Saving the file in the MyDokuments wouldn't work too, would it? But I'm not sure if i understand, what you mean with : Quote:
What i was trying to do. Save the skript as a file and execute it with a pen tab/klick. Thanks again for the help! Eismaus |
Re: Save scripts.. What extension do i need?
- Programs and scripts are executable anywhere on the internal flash, so in MyDocuments would work too.
- You need the path to the file when you execute the script, unless the directory where the script resides is in the PATH environment variable. You can check the current value of the environment variable with Code:
env | grep PATH It's probably something like bin:/usr/bin (I'm not certain what the default path is, because I have changed mine. More on that below.) Now, it's possible to extend the default path. You could make a directory $HOME/bin (which is the same as /home/user/bin) with 'mkdir', and put your script(s) there. If you create or edit the file .profile (note leading dot) in the home directory and add the line Code:
PATH=$HOME/bin:$PATH But then you wanted to execute the script by just a stylus click.. that was more tricky! But I seem to remember someone had hacked together a little applet or other gui program to just execute commands or scripts -- maybe they will step forward? |
Re: Save scripts.. What extension do i need?
Ah, now it is clear. Thanks for the explantion.
I have successfully written an easy script with i can execute from the shell. The next step is to mapp and unmap my work/Home direktory with a script. If someone have more information about this applet/programm, please tell? Thanks all for your help. Eismaus |
Re: Save scripts.. What extension do i need?
Get an app called "load-applet-run". It creates an icon in the status bar and you can add run commands to the dropdown list. It's also just a nice icon/app that shows time, CPU and memory graphs too... worth having.
http://downloads.maemo.org/product/load-applet-runn/ Works fine on my N800. |
Re: Save scripts.. What extension do i need?
I may have named the wrong applet above... the one I was thinking of is "Clockified osso-statusbar-cpu".
http://maemo-hackers.org/wiki/OssoStatusbarCpu |
Re: Save scripts.. What extension do i need?
I'm using load-applet-run, it works as you described so your original post seems correct to me. :)
|
Re: Save scripts.. What extension do i need?
I've been trying to redownload gnuite's applet for use with a N800 lately, but all I get is this error :
Server Error Component org.openpsa.products failed to handle the request Error 500 downloads.maemo.org Thu, 15 Nov 2007 15:01:33 +0200 Apache/2.2.3 (Debian) DAV/2 PHP/5.2.0-8+etch7 mod_ssl/2.2.3 OpenSSL/0.9.8c Midgard/1.8.4 Stacktrace: 1: /var/cache/midgard/midgard/11-88-31-0.php:0 {main} 2: /var/cache/midgard/midgard/11-88-31-0.php:148 midcom_application::codeinit 3: /usr/share/midgard/svn/midcom/trunk/src/midcom.core/midcom/application.php:571 midcom_application::_process 4: /usr/share/midgard/svn/midcom/trunk/src/midcom.core/midcom/application.php:1006 midcom_application::_handle 5: /usr/share/midgard/svn/midcom/trunk/src/midcom.core/midcom/application.php:1113 midcom_application::generate_error I also downloaded the 2006 version from gnuite's "770 hacks" page, installed it and rebooted, but nothing shows up... I had this on my 770 and really miss it :-) |
Re: Save scripts.. What extension do i need?
load-applet-run? It seems to be in respository.maemo.org mistral free.. at least that's what 'apt-cache policy load-applet-run' tells me.
http://gronmayer.com/n800/repos/ says it's in both of these: (0.4.3-2 is the version I'm using without problems on my N800): http://repository.maemo.org/extras mistral | free non-free load-applet-run (v. 0.4.3-2) http://repository.maemo.org/contrib mistral | free load-applet-run (v. 0.4.3-2) |
Re: Save scripts.. What extension do i need?
Well, I only have Bora repos on my N800 ATM, so it doesn't show up in the app manager... I was trying to get it from the maemo.org download page linked a few posts back :
http://downloads.maemo.org/product/load-applet-runn/ Probably got broken in the great maemo.org revamp. I am unable to find that applet again on the new site by conventional means - that search function is incredibly broken too. |
Re: Save scripts.. What extension do i need?
|
Re: Save scripts.. What extension do i need?
Okay, hold fire... it's just me being dumb. I actually had it installed okay, but just now discovered that "new" dialog buried deep inside the control panel, that lets you control what icons appear in the taskbar. Didn't exist in OS2006 - remember, this is a diehard 770 caveman only just discovering the marvels of OS2007 ! (only for a few days/weeks too, until OS2008 comes out :-)
|
Re: Save scripts.. What extension do i need?
Hi, thanks for all the input.
I hadn't time to play with my tablet much in the last days because of the medica exhibition/fair where I'm working right now. Probably have time to play again at monday. Eismaus |
Re: Save scripts.. What extension do i need?
I know this thread is a little old, but I need some info. I have saved my script, and am not trying to add it to .profile but I am not sure what that means. Where do I pu the PATH line?
|
All times are GMT. The time now is 12:56. |
vBulletin® Version 3.8.8