Looking at the link and also your path it looks like you have installed Macports. Its installer will change in ~/.profile the path but not in the way you show. See macports document for the correct way to do this.
Editing /etc/profile is not the correct way as it affects all users and is also more complex to deal with as requires root permission and is also an Apple supplied file that could be changed in Apple system upgrades
This explains two of your /opt/local/bin ... etc in your path (/etc/profile and ~/.profile) More and the PATHnexport
imply that yor editing of files has gone wrong.
I would restore /etc/profile from a backup to be as Apple set it up, and check that .profile has the lines as per the macports document. Also check to see if you have ~/.bash_profile or ~/.login and check they do not have any alterations to the PATH
If you are not used to Terminal (e.g. if you do not understand what these .profile files are) then it mght be better to install wine via a GUI method e.g. Wineskin or Crossover (Even if you do understand Terminal and shells t is easier to use these)
I went through the exact same process back when I was playing around with logKext. The unix command you may want to explore is /usr/bin/expect.
It can get complex quickly, but basically what it does is act as a mediator between you and the programs you're running so it can provide answers that you would normally have to type. As an example, I built this script so I could automate the process of printing the logKext output. You should recognize all of the commands you'd normally type to logkextClient yourself...
#!/usr/bin/expect -f
spawn logkextClient
expect "logKext Password:"
send "mylogkextpassword\r"
expect "logKextClient > "
send "print\r"
expect "logKextClient > "
send "quit\r"
close
Back in 10.5 and 10.6 this worked well for me for outputting the logKext print so I could pipe it into an email and send it. However, I was running this logged in as root to terminal, so it was simple.
Theoretically, if you weren't logged in as root, you could instead say
#!/usr/bin/expect -f
spawn sudo -k logkextClient
expect "Password:"
send “myrootpassword\r”
expect "logKext Password:"
send "mylogkextpassword\r"
expect "logKextClient > "
send "print\r"
expect "logKextClient > "
send "quit\r"
close
(note that I used sudo -k
intentionally to be consistent and require a password every time)
So you could use your favorite command line editor to create this script, do a chmod +x
to it and drag it to the dock for launching... Theoretically.
But I have been having problems in Mavericks getting /usr/bin/expect to behave properly with sudo, so this isn't working for me in other scripts like it should. And I don't have logKext installed at all anymore for testing anyway.
But I think this is the direction you may want to head.
Good luck!
Best Answer
You need an alias. Typing
alias sage='open /PATH/TO/Sage.app'
will create an alias which will do exactly what you want, run the program just by typingsage
. The problem is that this will only last until you close that terminal window (bash). So, you need to create that alias each time you run a new bash. To do so, just:.bash_profile
in your home directory.alias sage='open /PATH/TO/Sage.app'
on it. ~/.bash_profile
Remember that it will be case sensitive, so if you type
Sage
(instead ofsage
) it won't work.