startup.sh
executable is added to the Mac OS X Path Variable so that is can be run from the terminal without having to use the full path name.Summary
- Add Entry to Mac OS X PATH Variable – Current Terminal Session Only
- Add Permanent Entry to Mac OS X PATH Variable – Current User Only
- Add Permanent Entry to Mac OS X PATH Variable – All Users on the System (Global)
1 Add Entry to Mac OS X PATH Variable – Current Terminal Session Only
- Open a new terminal window and use the echo command to view the PATH variable.
- By default, the variable should be set to something like this on Mac OS X Sierra (here 10.12.5):
- On my system, the Tomcat home is located at
/Applications/apache-tomcat-9.0.0.M17
- Staring the server using the
startup.sh
, requires using the full path name, otherwise it is not found.
Ifort Mcmodel
- To add the Tomcat
bin
folder to the PATH variable for the current terminal session only, execute:
- Use
echo
again to confirm the new entry to PATH:
- For the current terminal session, the script
startup.sh
can now be executed from any location.
- This PATH entry will be lost when closing the current terminal and is not available in a new terminal.
2 Add Permanent Entry to Mac OS X PATH Variable – Current User Only
- To permanently add a PATH entry for the current user, navigate to the
home
folder:
- And execute the below command to edit the user’s bash profile. Bash is the default shell on Mac OS.
- Add the desired PATH entry with e.g. GNU nano as shown below. Use
CTRL+O
to save changes andCTRL+X
to exit.
- For the changes to take effect, close the current terminal window and open a new one.
- Use
echo $PATH
again to confirm the entry was added.
- Whenever a terminal is opened by the current user, the bash profile will add the specified PATH entry.
3 Add Permanent Entry to Mac OS X PATH Variable – All Users on the System (Global)
- To permanently add a PATH entry for all users on Mac OS (global), the
/etc/paths
file is used. - Open the file for editing by running:
- Add the desired PATH entry as shown below. This file maintains a list of PATH entries, one per row:
- Use
CTRL+O
to save changes andCTRL+X
to exit. - Switch to another user on the Mac and confirm that the PATH entry is present.
- Note: Here, the user edgar will only be able to actually run the Tomcat startup.sh if the permissions have been set correctly by the user that owns the files. See chmod for setting permissions.
- If read and execute permissions have not been set, errors indicating that the file was not found and other permission errors will occur.
- Please register to leave a comment if you know additional or better approaches.
The command to invoke the compiler is ifort.
Note
For Windows and Mac OS* X systems, you can also use the compiler from within the integrated development environment.
Requirements Before Using the Command Line
On Linux* and Mac OS* X operating systems, you need to set some environment variables to specify locations for the various components prior to using the command line. The Intel Fortran Compiler installation includes a shell script that you can run in your terminal window to set environment variables. For more information, see Using the compilervars File to Specify Location of Components.
On Windows* operating systems, you typically do not need to set any environment variables prior to using the command line. Each of the Intel® Fortran Compiler variations has its own Intel Compiler command-line window, available from the Intel Fortran program folder. This window has the appropriate environment variables already set for the command-line environment.
Using the ifort Command from the Command Line
Use the ifort command either on a command line or in a makefile to invoke the Intel Fortran compiler. The syntax is: