Would it be much to switch the script to bash? would that better? I only have experience with sh, tcsh and bash. An Mac OS X doesn't come with ksh installed, i could include it in the bundle though that would be ugly seeing as i'd still need another executable to find the path to it (i think), can a shebang be something like #! ../ksh ?
Quote:
You can use the # and % trick to get rid of basename and dirname too.
and what might that trick be?
Quote:
You will have to maintain a file that is writable by whatever user or group will run the script.
Your code does a "cd ../../" to go up two levels, and that directory and whatever filename you choose to place in there is what I'm talking about. The file keeps count for you. Unix isn't like Windows - there is no Registry.
Let's ignore concurrency issues for now (file locking). You'll need help with that later on.
Do you want a current running count of the processes extant on the system - or just a running count of how many times the script has been executed since day one?
Couldn't quite make sense of all of that. I'm on a mac and this is meant to be a cocoa bundle I'm making (if that means anything to you). I just want the script to update the number in the bundle's (.app) name whatever it might be, which means the user can reset it to whatever they want without having to open it up (simply by renaming it).