Dot Space Dot script calling syntax

I had written a shell script that captured network values from a running set of K8s service nodes. The network values would change as I built and destroyed the cluster. I needed a handy way to update the env values of interest so I created a small shell script that fit the bill. The script captured the values correctly but never set the env values after I ran it. After some head scratching I discovered the Dot Space Script calling syntax. It’s shorter than typing source each time and super handy.

$ . ./path/to/set_my_env_vars.sh

Dot Space Dot calling syntax makes the script run under the current shell instead of starting another one (which is what happened when I ran ./set_my_env_vars.sh). The environment variables are now correctly set and available after the script exits - nice.

How to Create Symbolic Links at the Command Line of Mac OS X

If you want to create and set a symbolic link at the command line in OS X, you will need to use the ln command with the -s flag (if you don't use the -s flag a hard link is set). You'll need to launch a terminal session in order to follow along.

How to Create a Symbolic Link

Here is the syntax for creating a symbolic link:

ln -s /path/to/original_file /path/to/symlink_file

After running this command the symlink will point to the original location. Depending on which directory you are setting up the link in you may need to sudo:

sudo ln -s /path/to/original_file /path/to/symlink_file

How to Remove a Symbolic Link

rm is your friend => but use it wisely:

rm /path/to/symlink_file

You can also use unlink:

unlink /path/to/symlink_file