. /root/.bash_profile
or source /root/.bash_profile
. which says to run that file in the current shell. Your method runs .bash_profile
in s subshell, That sets up the variables in the subshell, then this subshell exits, taking these variables with it.
↧
Answer by stew for Run bash_profile in cron job
↧