我有一個shell腳本,需要您在此方面的專業知識。如何使用sed格式化輸出
SearchAirline() {
echo "Enter Airline Name:"
read airlineName
if [ $? -eq 0 ];then
echo -e "\t\t\E[43;31;1mFlight Information\E[0m"
echo -e "Departure Time Flight Airlines Vacancy"
echo "__________________________________________________________________________"
#cat flightlist.txt | grep $airlineName flightlist.txt
old_IFS=$IFS
IFS=$'\n'
for LINE in `sed -e '$airlineName' flightlist.txt`
do
print_flight $LINE
done
IFS=$old_IFS
fi
}
它不起作用給我過濾列表。相反,它會打印整個列表。