CP with a Shell Script

Your first CP will contain a simple shell script that displays the message "Hello, world!" with the help of the gtkmessage utility.

Hello World Message

  1. Log into Local Terminal as root.
  2. Change into the /custom directory: cd /custom
  3. Make a hello directory for your CP contents: mkdir hello
  4. Change into the hello directory: cd hello/
  5. Open a new plaintext file using the GNU Nano editor: nano hello.sh
  6. Put this content into the file:

    gtkmessage -m "Hello, World!" -t "Hello" -o "Close"

  7. Save the file by pressing [Ctrl]+[o], [Return].
  8. Exit the GNU Nano editor by pressing [Ctrl]+[x].
  9. Make the file executable: chmod a+x hello.sh
  10. Run the shell script from the command line to test it: ./hello.sh
    A message window like the one pictured above should open. You can close it with the Close button.
Last update: August 1, 2019