I am using chroot in a script, the purpose is to run a command, here is chroot syntax:
chroot [OPTION] NEWROOT [COMMAND [ARG]...]
The problem is the command I am running needs to take a variable defition, like this -
chroot /myroot FOO=BAR my_cmd
But when I do this, I get error message bash : FOO=BAR, no such file or directory
, looks like the first position must be command.
Is there a workaround of this?