大哥大姐们,我完全照书上编的也出现错误啊!

#!/bin/bash
#This program is used to study if then
#VBird 2002/06/27
echo "press 'y' to contiue"
read  yn
if [ "$yn" = "y" ];then #[空格"$yn"空格=空格"y"空格]
   echo "script is running..."
else
   echo "stop!"
fi

[ "$yn" = "y" ]
注意两边的空格

正解