从chroot主机(在chroot之外)在schroot环境中运行命令?

我有一个程序在schroot环境中运行。 我可以运行这样的没有错误:

user@precise:~$ schroot -c trusty (trusty)user@precise:~$ myprogram.sh my.Rmd 

但是,当我一次性调用脚本时,它会失败:

 schroot -c trusty -- myprogram.sh my.Rmd 

错误信息:

 Error in yaml::yaml.load(enc2utf8(string), ...) : Scanner error: mapping values are not allowed in this context at line 2, column 7 Calls: render ... yaml_load_utf8 -> mark_utf8 -> <Anonymous> -> .Call Execution halted 

我想不知道为什么chroot的环境variables没有正确的提供给程序。

顺便说一下这个程序是:

 #!/bin/bash # myprogram.sh # This is run inside a chroot /usr/bin/Rscript -e "library(rmarkdown); render('$1', 'all')"