then
echo "amending"
# нельзя изменить код служащего .
echo -n -e "EMPLOYEE NO: $CODE\n"
echo -n "FIRST NAME : [$F_NAME] >"
read _F_NAME
: ${_FNAME:=$F_NAME}
echo -n "SURNAME : [$S_NAME] >"
read _S_NAME
: ${_S_NAME:=$S_NAME}
echo -n "DEPARTMENT : [$DEPART] >"
read _DEPART
: ${_DEPART:=$DEPART}
grep -v $CODE $DBFILE >$HOLD1
if [ $? -ne 0 ]; then
echo "Problems creating temporary file..check it out"
exit 1
fi
if continue_promptYN "Ready to save this record" "Y"; then
echo "$CODE:$_F_NAME:$_S_NAME:$_DEPART" >> $HOLD1
mv $HOLD1 $DBFILE
if [ $? -ne 0 ]; then
echo "Problems moving temporary file…check it out"
fi
echo " Record Amended" # сортировка файла после изменений sort +2 -t: $DBFILE >$HOLD2 2> /dev/null
if [ $? -ne 0 ]; then
echo "problems trying to sort the file..check it out"
exit 1
fi
mv $HOLD2 $DBFILE if [ $? -ne 0 ]; then