Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1469  / 12 Months ago, wed, may 31, 2023, 7:44:43

I try to set the $PATH reference to the current working directory, one machine work as expected, but another machine is not.



basically, I have set below line in .bashrc



export PATH=$PWD/bin:$PATH


if I move directory to /123, I expected that the $PATH will updated to /123/bin:$PATH but it isn't.



Are there anyway to make it read the current $PWD to use in $PATH?


More From » bash

 Answers
1

Add the following line in ~/.bashrc to add ./bin directory in PATH



export PATH=./bin:$PATH


Next you need to run in terminal source ~/.bashrc to affect the change.


[#27986] Friday, June 2, 2023, 12 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
peafowkes

Total Points: 356
Total Questions: 102
Total Answers: 117

Location: Lebanon
Member since Tue, Oct 12, 2021
3 Years ago
peafowkes questions
;