Linux Commands Cheat Sheet
.profile_user
Let's take a quick look at what is being done by the .profile_user login script, using cat (concatenate):
Code Block |
---|
cd
cat .profile_user
#!/bin/bash
# Change the command line prompt to contain the current directory name
PS1='stamp:\w$ '
# Ensure all created files can be read/written by group members
umask 002
# Use yellow for directories, not that horrible blue
dircolors .dircolors > /dev/null
# Make common useful software available
module load python
module load launcher
# Environment variables for useful locations
export BI=/corral-repl/utexas/BioITeam
export CLASSDIR="$BI/core_ngs_tools"
# Add current directory and $HOME/local/bin to PATH
export PATH=.:$HOME/local/bin:$PATH |
Environment variables and echo
Environment variables are just like variables in a programming language (in fact bash is a complete programming language), they are "pointers" that reference data assigned to them. In bash, you assign an environment variable like this:
Code Block |
---|
export varname="Some value, here it's a string" |
Tip |
---|
Be careful – do not put spaces around the equals sign when assigning environment variable values. Also, always use double quotes if your value contains spaces. |
You then refer to the environment variable with its name, preceded by a dollar sign, like this:
Code Block |
---|
echo $varname |
In your .profile_user we set a couple of environment variables to
Important keyboard shortcuts
...