ok what i need to do is to make a script function which allows me to change the records in a file. I read some other posts about using sed but i still could not get it to work. The function runs But nothing changes in my file.
This is what my file contains:
Name, Dept, Job, Pay
Jack,FinanceDept,Accountant,$1000
and my code:
function editInfo
{
clear
read -p "Enter current info to edit: " oldInfo
read -p "Enter new info: " newInfo
sed -i 's/oldInfo/newInfo/g' "$dataFile"
}