I want to open programs in Terminal by writing a single command, like what is already done for Java complilation:
javac HelloWorld.java
For any program I install, that functionality isn't available. For example, to open SWI-Prolog I have to type
/opt/local/bin/swipl
when I want to type just
swipl
which results in a -bash: swipl: command not found
. How do I create this new command?
Adjust the BASH PATH environment variable. Edit your .bash_login
or .bash_profile
in your home directory, add at the end of the file the follwing lines:
PATH=$PATH:/opt/local/bin
export PATH
Source your file or simply close the current terminal and open a new one.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.