2

I want to be able to completely close termite from within a bash script. I have something like this:

while true; do
    read -n 1 -s result
    case $result in
        [c]* ) exit 0;;
    esac
done

And I want hitting c to close termite.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Marcel
  • 475
  • 1
  • 8
  • 21

1 Answers1

4

Execute your command with exec command to replace your bash with your script and when your script interpret exit command it will close your terminal.

Run your command like: exec ./myscript.sh

NOTE: Your script must have execute permission.

Sepahrad Salour
  • 2,629
  • 3
  • 20
  • 27