What is wrong with this shell command
===

I need to add this to `.bashrc`

    echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

but i am using a shell script and i need to run this under another user so i tried the following..

    BASH_COMMAND='[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"'
    sudo su ${USER} -c "echo '${BASH_COMMAND}' >> ${HOME_BASE}${USER}/.bashrc"

I was expecting to see 

    '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

in my `.bashrc`

but i see this instead


    sudo su ${USER} -c "echo echo 'sudo su ${USER} -c "echo '${BASH_COMMAND}' >> ${HOME_BASE}${USER}/.bashrc"' >> /home/deploy/.bashrc >> ${HOME_BASE}${USER}/.bashrc"

What am i doing wrong with the script
