Hi,<div><br></div><div>Many of my commands have to be in the chrooted environment for the dest host, e.g.: chroot $prefix cmd arg1</div><div><br></div><div>If I have many of these chrooted commands it quickly become tedious to prepend each with chroot prefix, so there are probably better ways of doing this?</div>
<div><br></div><div>I have tried this, but it doesn't work, and the installation process seem to hang:</div><div><br></div><div>#!/bin/sh</div><div><div>if [ -e /usr/lib/xen-tools/common.sh ]; then</div><div> . /usr/lib/xen-tools/common.sh</div>
<div>else</div><div> echo "Installation problem"</div><div>fi</div><div>chroot ${prefix} /usr/bin/apt-get update</div></div><div><br></div><div>chroot ${prefix} /bin/bash -e -x</div><div><br></div><div>command 1</div>
<div>command 2</div><div>...</div><div><br></div><div>exit</div><div><br></div><div><br></div><div>Are there any better way of executing several chrooted commands?</div><div><br></div><div>Matt</div>