Shell Scripts


Kramy

Active Member
Joined
Mar 15, 2008
Messages
688
Edit: Figured it out.
CODE
find /mnt/sd/game/_Java -name jamvm -print >> dir.txt


Question 2: How do I store the result of 'find' in a variable?
Edit: Solved
CODE
MYVAR=`find /mnt/sd/game/_Java -name jamvm`


Question 3: How to I change the order dirs appear in the Games menu?
 
Kramy said:
Question 3: How to I change the order dirs appear in the Games menu?
In what sense ? You could pipe the output thru `sort' for alpha, numerical, etc... or use `ls -t' to sort on date...
 
Last edited by a moderator:
simonb said:
Kramy said:
Question 3: How to I change the order dirs appear in the Games menu?
In what sense ? You could pipe the output thru `sort' for alpha, numerical, etc... or use `ls -t' to sort on date...

Sorry - my Question 3 was mostly unrelated to Shell Scripts. I was just wondering because I hate scrolling through 30 items to find the right dir, so I can then test the shell script again. :lol: When I said the Games Menu, I mean the GP2X Games menu.


juanvvc: Thanks!

Edit: I'm messing with the Java launcher script, so I can place it anywhere on my SD card.

Anyway...can someone clarify the behaviour of this line?
CODE
LD_LIBRARY_PATH=$JAMVM/sdl:$JAMVM_CP/lib/classpath:$LD_LIBRARY_PATH

QUOTE
LD_LIBRARY_PATH=$JAMVM/sdl:$JAMVM_CP/lib/classpath:$LD_LIBRARY_PATH


Thanks!
 
Last edited by a moderator:
To prevent scrolling 30 items, a quick solution is naming your test directory AAA and it will be the first in the list. Besides, you can use GMenu2x and categorize games in your own way.

That particular line means "add these two directories to LD_LIBRARY PATH". If you write just: LD_LIBRARY_PATH=$JAMVM/sdl:$JAMVM_CP/lib/classpath, you will lose the original contents of LD_LIBRARY_PATH, if any. It is save to use that sentence even if LD_LIBRARY_PATH was originally empty.

By the way, LD_LIBRARY_PATH holds the directories to search for dynamic libraries (DLLs in Windows) Since you want to prioritize libraries in JAMVM over system libraries, you add the original LD_LIBRARY_PATH to the end of the new variable.
 
juanvvc said:
To prevent scrolling 30 items, a quick solution is naming your test directory AAA and it will be the first in the list. Besides, you can use GMenu2x and categorize games in your own way.

That particular line means "add these two directories to LD_LIBRARY PATH". If you write just: LD_LIBRARY_PATH=$JAMVM/sdl:$JAMVM_CP/lib/classpath, you will lose the original contents of LD_LIBRARY_PATH, if any. It is save to use that sentence even if LD_LIBRARY_PATH was originally empty.

By the way, LD_LIBRARY_PATH holds the directories to search for dynamic libraries (DLLs in Windows) Since you want to prioritize libraries in JAMVM over system libraries, you add the original LD_LIBRARY_PATH to the end of the new variable.

Thank you very much. It makes sense now. :D

I dumped the contents of the var; it was really, really long. It's safe to say it doesn't get cleared; it just keeps adding on to the front. :eek:

Anyway, my new java launcher script appears to work from any dir; I successfully ran a jar file that wrote some text to a text file on my F200. :D It also avoids that annoying second java launcher; just goes right into the app!

Oh, and it restores the LD_LIBRARY_PATH var on exit. :lol:

Once I clean up some stuff, and determine if I messed anything up, I'll post it. More testing tomorrow!
 
Last edited by a moderator:
Hehe...getting SDL to work properly when JamVM it isn't in the correct path is a pain. I think it might have to be recompiled. Oh well.
 
Back
Top