On 26.08.2017 11:10, Colin Watson wrote:
sudo chroot /path/to/chroot sh -c 'cd /foo && ls -l'
The -c option is not the only way to pass a script to the shell. You can also pipe it in.
This means dealing with shell quoting, which is tedious and error-prone.
sh <<'end' echo 'hello, world' end