Results 1 to 3 of 3
  1. #1
    jago svensson
    Guest
    Question .command [Where am i?]
    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

  2. #2
    .command [Where am i?]

    Member Since
    May 27, 2006
    Location
    Concord, NC
    Posts
    445
    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.

  3. #3
    jago svensson
    Guest
    Hi.
    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 Originally Posted by karudzo
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Recent convert, command+c, command+v strange to reach on keyboard
    By milliamp in forum OS X - Operating System
    Replies: 3
    Last Post: 05-16-2015, 02:20 PM
  2. Way to disable control+command+eject command
    By brasil2908 in forum OS X - Operating System
    Replies: 1
    Last Post: 09-19-2014, 02:06 PM
  3. Compare OS X command line to Linux command line?
    By V6Pony in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 09-26-2013, 12:32 PM
  4. What is the fi command?
    By Kiarocks in forum OS X - Operating System
    Replies: 3
    Last Post: 12-05-2011, 10:23 AM
  5. Command F
    By andsomecement in forum Apple Notebooks
    Replies: 1
    Last Post: 05-01-2010, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •