hi
I want to use system (or any method that works

to call the following chroot command in bash.
Code:
chroot "$LFS" /tools/bin/env -i \ HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h
the 'PS1='\u:\w\$ ' ' gave me lots of problems so i exported it as a variable = $PSNEW
i just cant seem to get the syntax right in c++ to pass the command, i tried plenty of variations and the code below is as correct as i've got . .
Code:
exitStatus = system("chroot \"$LFS\""
" /tools/bin/env -i"
" HOME=/root TERM=\"$TERM\" \"$PSNEW\""
" PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin"
" /tools/bin/bash --login +h");
any ideas please ?