title: How we can code Ctrl+D in a shell script?
body: <p>I need to code <kbd>Ctrl</kbd>+<kbd>D</kbd> in a shell script in order to exit and display the result of a code.
  The goal it's instead of &quot;bye&quot; in my code I tried to find a solution on google and in other website to replace &quot;bye&quot; by a <kbd>Ctrl</kbd>+<kbd>D</kbd> code.</p>
  <p>Can you help me please?</p>
  <p>This is my code :</p>
  <pre><code> touch file.txt
   while :
  do
      shopt -s nocasematch
      
    read INPUT_STRING 
    case $INPUT_STRING in
       bob)
          echo &quot;boy&quot;&gt;&gt;file.txt
          ;;
      alicia)
          echo &quot;girl&quot;&gt;&gt;file.txt
          ;;
      cookie)
             echo &quot;dog&quot;&gt;&gt;file.txt
             ;;
      bye)
          cat file.txt
          break
          echo &quot;      &quot;
          ;;
      *)
          echo &quot;unknown&quot;&gt;&gt;file.txt
          ;;   
    esac
    
  done
  </code></pre>