I have installed
nvm and it was appended to my
$ bash -c nvm bash: nvm: command not found
does not work.
same when I specific the rcfile
$ bash --rcfile /home/www-data/.bashrc -c "nvm" bash: nvm: command not found
Why is that?
In the end-result I want to use nvm in RoboFile exec() command and tried to wrap it into
bash -c because
nvm is a bash function and not a real script.
When invoked with
-c, bash runs as a non-interactive shell. The default interactive shell startup files (
~/.bashrc) are not read. Even if you force
~/.bashrc to be read, its body is likely not executed – the default Ubuntu one (copied from /etc/skel during account creation) for example includes the lines
# If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac
which bypasses everything following.
You could force an interactive shell using
bash -ic, however that may cause other issues depending on what else is in your
Answered by steeldriver