You are not logged in.
Pages: 1
I am trying to set a bash prompt different for chroot. I put a .bashrc file in /opt/arch32/root/ and it works fine if I
su
to root then
chroot /opt/arch32
but if I just
sudo chroot /opt/arch32
it uses the colors from my normal user bash prompt.
I am trying to set an alias in my .bashrc so it will su then chroot /opt/arch32, but I have never used alias or dug into bash that much and I can't seem to get it to work.
I tried
alias arch32='su && chroot /opt/arch32
but that didn't work.
Any help would be great.
Thanks
Offline
su -c chroot /opt/arch32
The -c switch passes a command to the shell started by su.
Your script currently starts a root shell and then runs chroot /opt/arch32 as the calling user.
M*cr*s*ft: Who needs quality when you have marketing?
Offline
su -c chroot /opt/arch32
The -c switch passes a command to the shell started by su.
Your script currently starts a root shell and then runs chroot /opt/arch32 as the calling user.
Thanks for the reply this is what I get with your suggetion
su: user /opt/arch32 does not exist
I also tried it straight from the command line same error.
***[EDIT]***
I figured it out. I did
su -c 'chroot /opt/arch32'
that did the trick
Thanks pointone
Last edited by cu3edweb (2008-10-11 20:14:49)
Offline
Pages: 1