Sup guys, today I tried to append a string from my text by asking the user to input and change the specific text they wanna append.
The problem is that, the code looks logically correct, but when I run it there's an error somewhere.
Can anyone identify for me?
echo "Search data"
read current
echo "Data to be changed"
read change
sed "/$current/$change" file.txt > file1.txt && mv file1.txt file.txt
My file.txt contains the following.
sampleA:Alex:30:10:10
sampleB1:Tracy:2.56:8:4
sampleZ5:Darryl:3:50:7
It gives me an error.
sed: -e expression #1, char 8: extra characters after command.
So let's say I want to change Alex name to Bryan is this the way to do it?