Neal, thanks alot for going through the script I appreciated.
well, I do have error detection i disable it on the script i attached. its like this Chapter5(){ GZ="tar -zxf" BZ="tar xjvf" exec 3>&1 #Start- This to handel stderr Chapter5_4 2>&1 1>&3 | sh $Error Chapter5_5 2>&1 1>&3 | sh $Error ..... ..... ..... exec 3>&- #Close - This to handel stderr } and the Error script look like this sed -e " s/\(.*\) \(.*\) \(.*\)/ * [ !Error ][ \1 \2 \3 ]/" this way i only see error output However, trap seem a better idea i will try to use it . i am running the script now and hope things go well thx again On Sat, Jul 3, 2010 at 1:10 AM, Neal Murphy <neal.p.mur...@alum.wpi.edu> wrote: > On Friday 02 July 2010 15:11:31 Face wrote: >> well, thank you all, i will start over and see what will happen. >> I am using a shell script to do the book if someone could take a look >> at it, that would be nice . >> >> >> Sincerely > > Ah, you don't seem to have error detection in your script. > > After many of your actions, you could put > || (echo "'action' failed."; exit 1) > > For example: > tar -jxf ../mpfr-2.4.2.tar.bz2 >>$Logs || \ > (echo "Extracting mpfr failed."; exit 1) > mv -v mpfr-2.4.2 mpfr | source $Msg || \ > (echo "Renaming mpfr failed."; exit 1) > > > Also 'man bash' and read up on the 'trap' built-in. You can do something like: > trap "echo \"'action' failed!\"; exit 1" ERR; action-to-take; trap "" ERR > > For example: > trap "echo \"Extracting mpfr failed.\"; exit 1" ERR > tar -jxf ../mpfr-2.4.2.tar.bz2 >>$Logs > > trap "echo \"Renaming mpfr failed.\"; exit 1" ERR > mv -v mpfr-2.4.2 mpfr | source $Msg > > trap "" ERR > > > You might have to change the script to use bash instead of sh. > > Cleverly crafted, you should be able to catch most of the errors when they > happen while maintaining a readable script. > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-support > FAQ: http://www.linuxfromscratch.org/lfs/faq.html > Unsubscribe: See the above information page > -- Sincerely, -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page