I don't seem to be able to pass an environment variable to a chroot:$ sudo apt-get install debootstrap dchroot$ sudo debootstrap trusty mychroot$ sudo chroot mychroot /bin/bash -c MY_VAR=5; echo ${MY_VAR}$
How to pass an environment variable when change rooting?
shell;environment variables;quoting;chroot
Use single quotes:$ sudo chroot mychroot /bin/bash -c 'MY_VAR=5; echo ${MY_VAR}'