Defer the execution of some ~/.bash-files commands, to be non-blocking
Andrew Henderson
I have my .bashrc and .bash_profile being loaded at shell start; except for some export and alias, there's a command that needs a couple of seconds to run:
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmAnd I need to wait this 2 seconds delay all the times I open a new terminal.
Given that I almost never use NVM and that I don't need it to be ready immediately after shell loading,
- how can I delay the execution of that command? (e.g. running 10 seconds after the shell is loaded)
- how can I set the execution of such command to be asynchronous so that it doesn't block the fast loading and readiness of my shell?