lundi 17 mai 2021

How can I grab a variable that has a dollar sign? [duplicate]

echo "Tell me the users."
echo -e "The limit is 5.\n"

for ((count=1; count<6; i++)); do
  read -p "$countº: " u$count

  if [ $'u$count' == "x" ]; then
    break 
  fi
done

My script isn't entering the if and I guess it's because of the variable. I've tried with (and without) " and ' in all places (I think so), but I couldn't break it (using the X letter).

Aucun commentaire:

Enregistrer un commentaire