echo "[...] waiting"
read
while true
do
clear
if [ -e ./out ]; then
rm ./out
fi
echo "[...] compiling..."
g++ ./*.cpp -o out
if [ -e ./out ]; then
echo "[:)] compile succeed!"
if [ -e ./testData ]; then
./out < ./testData
else
./out
fi
else
echo "[:(] compile failed"
fi
echo "[...] waiting..."
read
done
转载于:https://www.cnblogs.com/maoruimas/p/10445811.html