Sunday, May 5, 2024
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 89542  / 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
feeous questions
Sat, Jul 23, 22, 23:21, 2 Years ago
Mon, Jul 5, 21, 19:59, 3 Years ago
Mon, Aug 16, 21, 11:42, 3 Years ago
Sun, Mar 19, 23, 21:03, 1 Year ago
;