title: How to know difference between [ENTER] and [SPACE] in bash
body: <p>I want to make a script that functions differently when pressed [Space] and differently when pressed [Enter] .</p>
  <p>what i tried:</p>
  <pre><code>#!/bin/bash
  
  read -n1 Input
  
  if [[ $Input == \n ]]; then
      echo &quot;Enter is Pressed&quot;
  elif [[ $Input == &quot;&quot; ]]; then
      echo &quot;Space is pressed&quot;
  fi
  </code></pre>
  <p>Any suggestions or advice is very helpful. Thanks</p>