September 2018
Beginner
186 pages
4h 30m
English
If we don't have root access, or we only want our script to be accessible to us, the other approach to getting our program in a PATH directory is to make our own bindir.
This can be any directory you like. The system does not require bin to be the name of the directory, but it's a good idea because it will make clear what the directory is for. We'll create a new user bindir in our home directory, called ~/bin.
First, we create the directory with mkdir, and then put hello inside it:
bash$ mkdir /home/bashuser/bin bash$ mv hello /home/bashuser/bin
If we try running hello now, it still doesn't work, because our new bindir is not yet part of PATH. We can do that by adding the directory to the end of PATH with a variable assignment: ...
Read now
Unlock full access