continue_promptYN()
{
• continue_jprompt _STR=$1 _DEFAULT=$2
• проверим, что параметры верны if [ $# -lt 1 ];. then
echo "continue_prompt: I need a string to display" return 1 fi
while : do
echo -n "$_STR [Y..N] [$_DEFAULT]:"
read _ANS
: ${_ANS:=$_DEFAULT}
if [ "$_ANS" = "" ]; then
case $_ANS in
Y) return 0 ;;
N) return 1 ;;
esac fi
case $_ANS in y|Y|Yes|YES)
return 0;;
n|N|No|NO) return 1;;
*) echo "Answer either Y or N, default is $_DEFAULT";;
esac
done }
display_rec() {
• отображение_записи
• можно применить команду cat « документ, но нежелательно tput cup 5 3
echo "EMPLOYEE NO: $CODE" echo "FIRST NAME : $F_NAME" echo "SURNAME : $S_NAME" echo "DEPARTMENT : $DEPART" echo -e "\n\n" }
no_recs()
{
# no_recs
echo -e "\n\nSorry could not find a record with the name $STR" }
get_rec ()
{