G'day
I highly recommend switching from csh to something like bash or zsh.
Stdio processing is not possible in csh. Read " csh programming is considered harmful ." An elegant treatise on the subject.
Sorry this is not a direct answer, but you will find that you will continue to bang your head about csh restrictions, the longer you stick to it.
A lot of csh syntax is already available in bash, so your learning curve won't be too steep.
Here is a short sentence for the same, written in bash. It is not elegant though.
#!/bin/bash TO_LOGFILE= "| tee -a ./install.log" tar -zxf Python-3.1.1.tgz 2>&1 ${TO_LOGFILE} if [ $? -ne 0 ];then echo "Untar of Python failed. Exiting..."; exit 5 fi cd Python-3.1.1 2>&1 ${TO_LOGFILE} if [ $? -ne 0 ];then echo "Can't change into Python dir. Exiting..."; exit 5 fi echo "============== configure ================" ./configure 2>&1 ${TO_LOGFILE} if [ $? -ne 0 ];then echo "Configure failed. Exiting..."; exit 5 fi echo "================ make ===================" make 2>&1 ${TO_LOGFILE} if [ $? -ne 0 ];then echo "Compile of Python failed. Exiting..."; exit 5 fi echo "================ install ================" make install 2>&1 ${TO_LOGFILE} if [ $? -ne 0 ];then echo "Install of Python failed. Exiting..."; exit 5 fi cd .. rm -rf Python-3.1.1 2>&1 ${TO_LOGFILE} exit 0
I added a little more checks and reports so that if a problem occurs at an earlier stage, the log file will simply contain until an error is detected, and not a stack of rather useless error messages from later phases, Anyway.
amuses
Rob wells
source share