HI guys i have a question.
Question 1: how do i modify a particular string?
e.g
echo "Please enter Book Title: "
read a
echo "Please enter Author: "
read b
if [[ $(grep "^$a:$b" file.txt | wc -l) -gt 0 ]]
then echo " Record found!"
which will then pop out a menu with the follow output
1. Update Name
2. Update email
3.Update age
4. Update Marital staus
The question is, what codes do i haave to put in in order to change only the searched record shown?
e.g
Please enter Name: Simon
Please enter email: username@email.com
Record found!
Update name : Alex ( option 1)
Updated email: username6@gmail.com (option 2)
edited file.txt should have
Alex:username6@gmail.com:17:Married
Desmond:username4@email.com:18:Single
Harry:username12@email.com:21:Married
Alex:username1@email.com:78:Married
my file.txt has
Simon:username@email.com:17:Married
Desmond:username4@email.com:18:Single
Harry:username12@email.com:21:Married
Alex:username1@email.com:78:Married
am using bash script.