0
while echo answer
read answer
do 
if [ $answer = 'A' ] && [ $code = filename]
then
   echo show A.
   break
elif [ $answer = 'B' ] && [ $code = filename]
then
   echo show B
   break
elif [ $answer = 'A' ] && [ $code != filename]
then
   echo No such THING.
   break
elif [ $answer = 'B' ] && [ $code != filename]
then
   echo No such THING.
   break
else:
   echo Enter only A or B.
fi
done

Hello, I hope someone can help. but I'm having some issues when I execute my program I receive "no such thing" when it should send show a.

Cyrus
  • 77,979
  • 13
  • 71
  • 125
  • 2
    Please add a suitable shebang (`#!/bin/bash`) and then paste your script at http://www.shellcheck.net/ and try to implement the recommendations made there. – Cyrus Mar 07 '22 at 11:18

0 Answers0