In terminal:

  • vi apple.sh (create bash file “apple.sh” and open the editor on terminal)
  • type:

#!/bin/bash

echo hello world

  • ESC; Shift + Z + Z (exit editing file)
  • chmod u+x apple (grant permission for current user to execute the bash)
  • ./apple (execute the bash)
  • expected result in terminal: hello world