Thread: .command [Where am i?]
07-04-2006, 02:51 PM #1jago svenssonGuest.command [Where am i?]
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.
07-04-2006, 03:26 PM #2
- Member Since
- May 27, 2006
- Concord, NC
- 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.
07-04-2006, 05:06 PM #3jago svenssonGuest
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.
Originally Posted by karudzo
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By milliamp in forum OS X - Operating SystemReplies: 3Last Post: 05-16-2015, 02:20 PM
By brasil2908 in forum OS X - Operating SystemReplies: 1Last Post: 09-19-2014, 02:06 PM
By V6Pony in forum OS X - Development and DarwinReplies: 5Last Post: 09-26-2013, 12:32 PM
By Kiarocks in forum OS X - Operating SystemReplies: 3Last Post: 12-05-2011, 10:23 AM
By andsomecement in forum Apple NotebooksReplies: 1Last Post: 05-01-2010, 02:46 PM