Quote:
Originally Posted by smartgenes
--no I'm new at this malarky, and I don't understand what that does or why I would be doing stuff at usr/bin in this case..
From what I understand I create the .ini file in the launchpad folder, which has within it:
!/mnt/us/fbgnuboy/rungame
So, it points to rungame - is this just a file we create in the relevant directory, and does it need a .sh extension?
There were 2 different scripts, do we need both of them called gnuboy.sh and one called rungame, or should everything be in one script (as I can't understand if there is meant to be two, how the second script is coming into play)
Presumably eips -g ./gb-flash.jpg does not need a path change as it already changes dir to the correct place.
What the stuff does only matters to me as I'm trying to understand where scripts should be as clearly I'm not doing it right... :-)
I wondered if HOME=/tmp would alter the cd /mnt/us/fbgnuboy so that ./fbgnuboy wouldn't run? I don't understand how that command works, though I understand it is there because of Gameboy requiring to write (plus whatever reasons relate to the custom modding link you sent).
Or maybe the prolem is because I'm saving the script in Notepad and not in Linux??
Anyway thanks for all the help, it's a learning curve..
edit: do I have to make the file gnuboy.log in advance?
|
okay few quick facts.
anything on FAT has "can be executed" status. That is to say it can be "Run".
Unlike ext3 where you must set the executable (octal thingy) bit in permissions.
so give it the extension .PoohBear and it will still try to run if you tell it to.
#!/bin/sh at the start does the heavy lifting of "I do what now?"
okay. so that known....
/blah/blah ./blah/blah and blah/blah are all different. (obviously)
1) root of the drive
2) relative to
current directory
(In the script mind, this pwd [present working directory] can change mid script and not affect the parent calling shell)
3) like 2 but implied.
The pwd (which is a commnd you can type on the command line) is stored in variable $PWD
[root@kindle root]#
pwd
so... that known... we could try this....
[root@kindle root]#
echo $PWD
therefore... if in doubt... in the future exactly where you "are" during a script you can drop in a
pwd
Simply stick
echo $PWD in the script (pictured, mine runs in /mnt/us/usr/bin/)
IN THIS CASE HOWEVER... using putei will lay it out nicely...
(pictured)
Heck you can put a
echo $PATH too in the script if you want to be sure...
So - to sum up. Get all the stuff in a known location.
cd to that location. run your script.
or put a call to
cd to a useful location IN your script (I did this)
if the stuff you are trying to reference IS NOT in the the $PWD (AND YOU ARE REFERENCING THE FILE LIKE ./MYFILE) and is not in the $PATH then it won't be found. those are the basic rules...
I probably missed a bunch of details, feel free someone to fill them in.
Hope you get it sorted mate.