R
R
RainJa2015-05-24 17:02:33
linux
RainJa, 2015-05-24 17:02:33

How to exit a shell procedure on an entered line?

A script is launched that displays information on the screen every n seconds, you need to organize an exit (end of the script) if a word is entered, for example quit, 2 times.
Those. quitting should be done by typing "quit quit".
How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2015-05-24
@BuriK666

ctrl+c doesn't work?

P
Power, 2015-05-24
@Power

Read about the shell's built-in read command and the optionally built-in test command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question