Files
mastering-unix-ss/chapter12/function_check_for_and_create_keyboard_file
Fabio Scotto di Santolo 4cc88d2f6e initial commit
2020-07-28 19:28:25 +02:00

33 lines
913 B
Plaintext
Executable File

function check_for_and_create_keyboard_file
{
# If the $KEYBOARD_FILE does not exist then
# ask the user to load the "standard" keyboard
# layout, which is done with the load_default_keyboard
# function.
if [ ! -s $KEYBOARD_FILE ]
then
$ECHO "\n\nERROR: Missing Keyboard File"
$ECHO "\n\nWould You Like to Load the"
$ECHO "Default Keyboard Layout?"
$ECHO "\n\t(Y/N): \c"
typeset -u REPLY=FALSE
read REPLY
if [ $REPLY != Y ]
then
$ECHO "\n\nERROR: This shell script cannot operate"
$ECHO "without a keyboard data file located in"
$ECHO "\n==> $KEYBOARD_FILE\n"
$ECHO "\nThis file expects one character per line."
$ECHO "\n\t...EXITING...\n"
exit 3
else
load_default_keyboard
$ECHO "\nPress ENTER when you are you ready to continue: \c"
read REPLY
clear
fi
fi
}