echo "Enter username"
read $WORD
if [[ "$WORD" =~ ^(Dale|Paul|Ray)$ ]]; then
echo "$WORD is valid"
else
echo "$WORD is invalid"
fi
답변1
read
명령 에서 오류가 발생했습니다 . read WORD
대신 사용하십시오 read $WORD
.
확인하다:
echo "Enter username"
read WORD
if [[ "$WORD" =~ ^(Dale|Paul|Ray)$ ]]; then
echo "$WORD is valid"
else
echo "$WORD is invalid"
fi