nix:pathvars
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
nix:pathvars [2020/01/06 15:37] – kauffman | nix:pathvars [2020/01/06 15:49] – kauffman | ||
---|---|---|---|
Line 76: | Line 76: | ||
</ | </ | ||
- | We will place our example script that echo's 'Hello World!' | + | We will place our example script that echo's 'Hello World!' |
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 82: | Line 82: | ||
</ | </ | ||
+ | and make it executable. | ||
< | < | ||
- | chmod +x ~/bin/hello | + | user@linux1: |
</ | </ | ||
+ | Now that we have our executable '' | ||
+ | As you may have guessed we will want to add (pre or postpend) '' | ||
+ | ==== The reason you are here ==== | ||
+ | |||
+ | < | ||
+ | $ export PATH=$PATH: | ||
+ | </ | ||
+ | |||
+ | To test we will need the shell to reevaluate $PATH. | ||
+ | < | ||
+ | $ hash -r | ||
+ | </ | ||
+ | |||
+ | Now we can see that '' | ||
+ | < | ||
+ | user@linux1: | ||
+ | / | ||
+ | |||
+ | user@linux1: | ||
+ | Hello World! | ||
+ | </ | ||
+ | |||
+ | ==== Making the change permanent ==== | ||
+ | Add the following line to a file called '' | ||
+ | |||
+ | | ||
+ | |||
+ | This will postpend our custom path to the search path every time we launch a bash login shell. | ||
+ | |||
+ | If you'd like to prepend just move your path in front of '' | ||
+ | |||
+ | export PATH=$HOME/ | ||
/var/lib/dokuwiki/data/pages/nix/pathvars.txt · Last modified: 2020/01/06 16:00 by kauffman