| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
|
Guest
Posts: n/a
|
Hi.
My first Thread here. Have a question about running .command files from the finder. When i exec them their workingfolder is always my home directory. I have a script that should execute a binary in the scriptfolder, witch is not a static path(on a removable media). how can i get the script to understand that it should start the binnary in the folder given, and not in my home folder.? Hope to finde some answers here. /thanx in advance. //Jago Svensson |
| QUOTE Thanks | |
![]() Member Since: May 27, 2006
Location: Concord, NC
Posts: 445
![]() Mac Specs: Macbook Pro 17" 2.6GHz 4GB RAM
|
simply change the place in the script that reads:
~/whatever or /Users/yourusername/whatever to a simple command. For example if I had a script that said: cp -R ~/example/ ~/backup/ it would back up the example directory in my home folder into a backup directory in my home directory. However if the script said: cp -R example/ backup/ it would back up the example directory in the current directory into a backup directory in the current directory. Hope that makes sense. |
| QUOTE Thanks | |
|
Guest
Posts: n/a
|
Thanx, but this is exactly what im doing, if I run the script from the terminal ./script, works perfectly the way its supposed. but the thing is that i want to make the script clickable, in finder, i renamed it to script.command, and if i run it from finder, it assumes that its workingdirectory is /Users/jago/ instead of /Volumes/BIGMAMA/crypto eaven if the script is placed in the lastfolder, and i run it from there. Could it be some setings in the terminal?, because i see no expl for it to behave this way. Quote:
|
|||||
| QUOTE Thanks | ||||||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
All times are GMT -4. The time now is 07:47 AM.
Powered by vBulletin