Adding path to Linux Shell environment

linux
path
addpath

#1

I am using the C Shell environment on Linux, how do I add the installation path for Lumerical’s software into my environment?

We have the following guide to add permanently Lumerical’s software installation path to All your Shell environment.

  1. To verify which shell script you are using type the command,

echo $0

  • It will show you what shell you are using, ie.

csh for C Shell
bash for Bash
tcsh for T Shell

  • To list the available shells on your Linux system,

cat /etc/shells

  • To switch to another shell, use the commands,

bash to switch to Bash
csh to switch to C Shell
tcsh to switch to T Shell

  • or use the change shell command,

chsh

  • You will be prompted for your user password and the shell you want to change to. Refer to the list of available shells from the command in #3 above for the correct shell location. Enter the shell,

/bin/bash to switch to Bash

  • To add the path permanently to all these shells, we will edit the .bash_profile file which is found in your user account’s folder using the command,

vi /home/<username>/.bash_profile
or
vi ~/.bash_profile

  • Add the path of the Lumerical software to the .bash_profile file as shown below using the default installation location.

export PATH=$PATH:/opt/lumerical/fdtd/bin
export PATH=$PATH:/opt/lumerical/mode/bin
export PATH=$PATH:/opt/lumerical/device/bin
export PATH=$PATH:/opt/lumerical/interconnect/bin

  • Save and Exit, then Log Out of the system.

  • Once logged backed into the system we can verify if the new PATH has been added to your shell environment by opening a Terminal window and run the command:

echo $PATH
or
echo $path

  • The new PATH for Lumerical’s software should be shown together with the system path for All your Shell environment.