Hi!
i’m trying to pipe an echo to three variables ,but all the values are assigned to the first variable only and the rest are empty , iv’e done this before so i don’t understand why its not working now
echo "$CHECK_USERS" | while read GAMES_PLAYED BAR BEST_GAME
do
echo "Welcome back, $USERNAME! You have played $GAMES_PLAYED games, and your best game took $BEST_GAME guesses."
echo "Guess the secret number between 1 and 1000:"
read GUSSED_NUM
done
the output is : ( Welcome back, k! You have played 1|8 games, and your best game took guesses. )
i’ve checked $GAMES_PLAYED and it’s value is ( 1|8 ) $BAR and $BEST_GAME are empty .