cd to a directory and execute many commands

view full story

http://unix.stackexchange.com – I have following script. #!/bin/bash mount /dev/sda6 /mnt/gentoo set +e cd /mnt/gentoo && mount -t proc none /mnt/gentoo/proc \ && mount --rbind /dev /mnt/gentoo/dev \ && mount --rbind /sys /mnt/gentoo/sys \ && chroot /mnt/gentoo /bin/bash \ && source /etc/profile \ && export PS1="(chroot)$PS1" What I am trying to accomplish here is to change to a directory /mnt/gentoo and execute few commands. This works ok first time when none of the path were mounted. But if I run it after mounting has been successfully performed on some paths, it d (HowTos)