-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_record
41 lines (40 loc) · 856 Bytes
/
update_record
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
NOW=`date '+%F_%H:%M:%S'`;
echo "J~Net PHP Database (c)J~Net 2022 The Time & Date Is $NOW"
echo ""
echo "Update Record"
echo ""
echo "Enter Your Name / Number"
read agent
echo "Enter Record Filename"
read input
# Check User input
if [ -z "$input" ]
then
echo "Use search_records Option To Find Records."
#break
else
echo "Enter Update Details"
read update
#cat $input > temp.txt
echo "Agent $agent Logged In AS $USER Updated Record $input @ $NOW" > temp.txt
echo $update >> temp.txt
cat temp.txt
while true; do
echo "Happy With This Update Correct? Y or N"
read yn
case $yn in
[Yy]* ) cat temp.txt >> $input
break;;
[Nn]* ) exit;;
* ) echo "Please Try Again.";;
esac
done
fi
echo "Record Updated!"
cat $input
echo "Press Enter To Continue"
read Y
rm temp.txt
clear
bash menu