Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If everything is working correctly you should now see a prompt like this:

Code Block
lstartacc:~$
Expand
Optional detail about what .profile does
Optional detail about what .profile does

What your .profile does

Let's look at what your .profile profile actually does:

Code Block
titlePrint the contents of your .profile file
lstar:~$ cat .profile

#!/bin/bash

# include common settings for the NGS course
. /corral-repl/utexas/BioITeam/bin/profile_ngs_course.bash

All this does is "import" some settings in the common /corral-repl/utexas/BioITeam/bin/profile_ngs_course.bash file into your environment, and all its descendents. The "import" operator is the period ( . ). This is also known as "sourcing a script".

So what does the common profile file do? For one thing, it sets an environment variable BI to point to the /corral-repl/utexas/BioITeam directory. So you can look at the file as shown below. Notice that if you hit TAB after typing cat $BI/ the shell expands the BI environment variable.

Code Block
titlePrint the contents of the NGS course common profile
lstar:~$ cat $BI/bin/profile_ngs_course.bash

#!/bin/bash

PS1='tacc:\w$ '
umask 002

export BI=/corral-repl/utexas/BioITeam
export PATH=$BI/bin:$HOME/local/bin:$PATH

module load launcher
module load python
module load samtools
module load R

The first line – the "she-bang" – tells the shell what program should execute this file – in this case, bash itself.

The PS1='tacc:\w$ ' line is a special setting that tells the shell to display the current directory as part of its prompt. It saves you typing pwd all the time to see where you are in the directory hierarchy. Try this:

Code Block
titleSee how your prompt reflects your current directory
lstar:~$ mkdir tmp
lstar:~$ cd tmp
lstar:~/tmp$

Your prompt now tells you you are in the tmp subdirectory of your home directory (~). To return to top-level of your home directory, just type

Code Block
titleHow to return to your home directory
cd

The export profile lines define the two shell variables BI and PATH. You've already seen how using $BI can come in handy accessing our shared course directory. As for PATH, that is a well-known environment variable that defines a set of directories where the shell will look when you type in a program's name. Our shared profile adds the common course /corral-repl/utexas/BioITeam/bin directory and your local ~/local/bin directory (which does not exist yet) to the location list. You can see the entire list of locations by doing this:

Code Block
titleHow to see where the bash shell looks for programs
echo $PATH

As you can see, there are a lot of locations on the path. That's because when you load modules at TACC (such as the module load lines in the common profile), that mechanism makes the programs available to you by putting their installation directories on your $PATH. We'll learn more about modules shortly.

...