uek2wooF Posted April 6, 2022 Share Posted April 6, 2022 Why is dot in root's PATH? root@Tower:~# echo $PATH .:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin Quote Link to comment
-MacGyver- Posted April 6, 2022 Share Posted April 6, 2022 By having . in the $PATH ./ does not need to prepend an executable command/script that is not in the path. For example you have myscript.sh located in a directory not in the path, maybe your home directory. To run the script without . in the $PATH you type this way: ./myscript.sh To run the script with . in the $PATH you can type this way: myscript.sh Quote Link to comment
uek2wooF Posted April 6, 2022 Author Share Posted April 6, 2022 (edited) yes I know. but it is bad practice, especially first Edited April 6, 2022 by uek2wooF added last part Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.