My .bashrc
file contains a line to this effect:
alias prog="/path/to/script.sh $(find $(pwd) -name prog)"
When I comment out this line, Bash starts almost instantly when I open a new terminal. With this line, there is a 4-5 second delay before my cursor shows up.
Removing the nested commands $(pwd)
, etc. speeds it up again as well. Why is this happening? Can I still use nested commands somehow?
find
command, which is execute at boot time and can take a long time to execute, depending on the directory structure. If you use single- instead of double-quotes,find
will be executed at run time, when thealias
is invoked. It depends on which working directory you want to use, that current at declaration time, or at run time. By the way$(pwd)
is a rather inefficient way to express.
or$PWD
.find
? Once you installed it, you know where it is. Even if you update it frequently and change its name, you can maintain a symbolic link to it so it's always available under a fixed name.