当前位置: 技术问答>linux和unix
shell语法错误。。。
来源: 互联网 发布时间:2016-10-26
本文导语: printf "Please input the CD's ID you want to delete: " read deleteID case "$del_choice" in 1) grep "^${deleteID}," $tittle_file echo "You are deleting this record and the related tracks." if get_confirm then sed -i -e '/'"^${deleteID},"'/d'...
printf "Please input the CD's ID you want to delete: "
read deleteID
case "$del_choice" in
1)
grep "^${deleteID}," $tittle_file
echo "You are deleting this record and the related tracks."
if get_confirm
then
sed -i -e '/'"^${deleteID},"'/d' $tittle_file
sed -i -e '/'"^${deleteID},"'/d' $tracks_file
printf "Delete successfully! "
fi
;;
2)
grep "^${deleteID}," $tracks_file
printf "nYou are deleting these records. "
if get_confirm
then
sed -i -e '/'"^${deleteID},"'/d' $tracks_file ##这行报错 printf "Delete successfully! "
fi
;;
esac
printf "Press ENTER to return to MENU..."
read
error: unexpected EOF while looking for matching '''
unexpected end of file
这个是部分代码,添加这部分之前程序是可以允许的。
read deleteID
case "$del_choice" in
1)
grep "^${deleteID}," $tittle_file
echo "You are deleting this record and the related tracks."
if get_confirm
then
sed -i -e '/'"^${deleteID},"'/d' $tittle_file
sed -i -e '/'"^${deleteID},"'/d' $tracks_file
printf "Delete successfully! "
fi
;;
2)
grep "^${deleteID}," $tracks_file
printf "nYou are deleting these records. "
if get_confirm
then
sed -i -e '/'"^${deleteID},"'/d' $tracks_file ##这行报错 printf "Delete successfully! "
fi
;;
esac
printf "Press ENTER to return to MENU..."
read
error: unexpected EOF while looking for matching '''
unexpected end of file
这个是部分代码,添加这部分之前程序是可以允许的。
|
直接改成这样试试
sed -i -e "/^${deleteID},/d" $tracks_file
sed -i -e "/^${deleteID},/d" $tracks_file