Home>

Nice to meet you, I thought I would make a bash command and return the parrot.
Find out about bash
read inp
echo $inp
If i say that, the characters you typed will be returned to the parrot and will be repeated on the screen, as I saw from a question of one person, but what should I do if I want to continue this?
I want to make a command to end parrot return when I type ecs
In that case, the teacher told me to use while, but I couldn't catch up with it.
I'm sorry it's been long, but in summary
I'd like to make a bash command that continues until the parrot return command is typed ecs, but I don't know so please let me know.

  • Answer # 1

    Tips

    I'm thinking about what to put after while to end with ecs, but I don't know

    Let's determine if ESC was pressed for each loop

    You can use if or case for judgment

    ESC$'\ e'is

  • Answer # 2

    whileIs "looping between true", so "$inpButecsIt's not equal to, but it loops between true. "