I source bashrc's of few of my friends. So I end up having duplicate entries in my $PATH variable. I am not sure if that is the problem for commands taking long to start. How does $PATH internally work in bash? Does having more PATHS slow my start up time?
Having more entries in
Duplicate entries are also a little annoying when you review your
It's easy enough to avoid adding duplicate entries.
Side note: sourcing someone else's shell script means executing code that he's written. In other words, you're giving your friends access to your account whenever they want.
I've seen people clean up duplicates from their PATH variable using
You could try adding that to your own bashrc and make sure you source the other files somewhere before running that.
An alternative would be to use the
As for your speed problem, this will not affect the startup time of the shell in any significant way but it may save some time doing tab completion for commands, especially when the command is not found in the path and it does repeated searches through the same folders looking for it.
A note on security: You should really heed Gilles' warnings about security here. By sourcing a file owned by another user you are giving a free pass to those users to execute their own code as your user every time you start a shell. If you don't trust those users with your password, you shouldn't be sourcing their shell files.
Only the first match in
To answer your question: this shouldn't be the cause of slow startup.