Bash Shell Scripting - return key/Enter key

Posted by veda on Stack Overflow See other posts from Stack Overflow or by veda
Published on 2010-04-10T04:44:44Z Indexed on 2010/04/10 4:53 UTC
Read the original article Hit count: 316

Filed under:
|

I need to compare my input with enter key/return key...

read -n1 key
if [ $key == "\n" ]
   echo "@@@"
fi

But this is not working.. What is wrong with this code

© Stack Overflow or respective owner

Related posts about bash

Related posts about shell