Simulating ENTER keypress in bash script Simulating ENTER keypress in bash script shell shell

Simulating ENTER keypress in bash script


echo -ne '\n' | <yourfinecommandhere>

or taking advantage of the implicit newline that echo generates (thanks Marcin)

echo | <yourfinecommandhere>

Now we can simply use the --sk option:

--sk, --skip-keypress Don't wait for a keypress after each test

i.e. sudo rkhunter --sk --checkall


You might find the yes command useful.

See man yes


You can just use yes.

# yes "" | someCommand