Bash Script Example of a Console Menu

Tiempo de lectura: < 1 minuto EnlighterJSRAW”>#!/bin/bash Function to print “Hello” function hello() { echo “Hello” } Function to print “Goodbye” function goodbye() { echo “Goodbye” } Menu echo “Select an option:” echo “1. Print Hello” echo “2. Print Goodbye” echo “3. Print Hello and Goodbye” read option case $option in 1) hello ;; 2) goodbye ;; 3) hello goodbye ;; … Read more