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:28] – kauffman | nix:pathvars [2020/01/06 15:37] – kauffman | ||
---|---|---|---|
Line 63: | Line 63: | ||
+ | ===== Manipulating the PATH variable ===== | ||
+ | Your shell will allow you manipulate the order in which these paths appear. It's as simple as setting a variable. | ||
+ | For the following examples I assume you are using the bash shell, which is the default in CS. The concept will translate to other shells, though the syntax may be different. | ||
+ | |||
+ | A common example to manipulate your path is if you have written a script and you'd like to invoke it without providing the full path: | ||
+ | |||
+ | Lets create the directory '' | ||
+ | < | ||
+ | user@linux1: | ||
+ | </ | ||
+ | |||
+ | We will place our example script that echo's 'Hello World!' | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | echo 'Hello World!' | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | chmod +x ~/bin/hello | ||
+ | </ | ||
/var/lib/dokuwiki/data/pages/nix/pathvars.txt · Last modified: 2020/01/06 16:00 by kauffman