Skip to content

Instantly share code, notes, and snippets.

@jakelogemann
Last active August 29, 2015 14:02
Show Gist options
  • Save jakelogemann/5c81736e1d1a90985288 to your computer and use it in GitHub Desktop.
Save jakelogemann/5c81736e1d1a90985288 to your computer and use it in GitHub Desktop.
bash snippets
#!/bin/bash
# The setleds command allows you to set the keyboard leds. In this example, set NumLock on:
setleds -D +num
# To turn it off NumLock, enter:
setleds -D -num
# clear the screen
tput clear
# Move cursor to screen location X,Y (top left is 0,0)
tput cup 3 15
# Set a foreground colour using ANSI escape
tput setaf 3
echo "XYX Corp LTD."
tput sgr0
tput cup 5 17
# Set reverse video mode
tput rev
echo "M A I N - M E N U"
tput sgr0
tput cup 7 15
echo "1. User Management"
tput cup 8 15
echo "2. Service Management"
tput cup 9 15
echo "3. Process Management"
tput cup 10 15
echo "4. Backup"
# Set bold mode
tput bold
tput cup 12 15
read -p "Enter your choice [1-4] " choice
tput clear
tput sgr0
tput rc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment