Thursday, May 16, 2024
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 89546  / 2 Years ago, sat, february 26, 2022, 12:09:08

Is it possible to run my scripts located in ~/scripts from anywhere?



Say i want to run ./scriptname regardless of my current working directory.


More From » command-line

 Answers
5

You can add ~/scripts to your $PATH environment variable. Then you can run scriptname from anywhere (but not ./scriptname, because the ./ denotes the current directory).



This answer shows how to add ~/bin to $PATH, but you can do the same with ~/scripts of course.


[#37454] Sunday, February 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
feeous

Total Points: 102
Total Questions: 122
Total Answers: 119

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
;