How to Execute After Read?

johnywhy

New Member
In zsh, If i press enter before the read is finished, then the last echo command gets executed. Great!

Code:
read -t 10 && echo 'bye'
But, if i DON'T press enter, then the final echo does NOT get executed.

How can i ensure the final echo gets executed if i allow the read to finish?

thx
 
Last edited:


johnywhy

New Member
Update, some progress:
Read may behave a bit differently in zsh.

But this doesn't work either:
Code:
bash -c "read -t 5 && echo 'bye'"
 

atanere

Well-Known Member
Nice work!

Welcome to the site!
 

Members online

No members online now.

Latest posts

Top