Updating path in bash shell
To execute the test script, run it from anywhere within the lab directory.
What we have been doing so far is single operations per command line.
You must indicate that you wish for the your script to treated as such by designating which program should be interpreting the command lines.
To make that designation, we use a , pronounced "shebang" tells the shell when reading this file, treat it as bash.
That means, you don't need to identify the type of the data you're storing to a variable.
Open the file as superuser in an editor as it's a read only file e.g. System will need password to open it in editable mode.
Suppose I want to add It looks like adding ~/bin to my path was a bad example, as there is already code in ~/.profile to do that automatically, if the directory exists.
To add the usr/local/foo directory to my path for every session going forward, I add/edit the following line at the end of my .profile: Going through the basics, I will suggest the following steps: 1.
For the scripts we'll write in this class, the commands will be stored in a file, but that file is interpreted by the bash shell.
That means each line actually runs like a sequence of command lines executed in the order they apear in the file as if they were typed onto the command line.