=====main.action======
#abc.sh
#!/bin/bash
echo -e "please in put the first number!"
read num1
if [ $num1 -eq 2 ];then
echo -e "please in put the second number!"
read num2
if [ $num2 == "abc" ];then
echo -e "the second number is : $num2"
else
echo -e "ERROR"
fi
else
echo -e "the first num is : $num1"
fi
=========================
=====a.txt========
2
abc
=================
运行方式:cat a.txt | sh abc.sh
哈哈 这个问题想了好久 .....郁闷死了