使用雙分號冒號的行編寫錯誤,在意外的標記附近指出語法錯誤。有什麼建議麼?Bash錯誤 - 使用雙分號冒號的行上的程序錯誤
#!/bin/bash
echo "Enter the access password..."
while
do
read INPUT_STRING
case $INPUT_STRING in
##CORRECT PASSWORD##
lux)
ls -l -S > directory.txt
echo "Enter your username..."
read a
sed '1 i\ $a' directory.txt
date=`date`
sed '2 i\ $date' directory.txt
date=
echo "The operation has completed successfully"
;;
##INCORRECT PASSWORD##
*)
x=1
while [ $x -le 3 ]
do
echo "Incorrect Password, try again. The program will exit after 3 failed attempts."
x=$(($x + 1))
sleep 2
echo "Enter the access password..."
if x=3
then exit
fi
;;
esac
done
echo
echo "Process Complete, Goodbye!"