textFileA consists of:
mango:oval:yellow:18pcs
apple:irregular:red:12pcs
orange:round:orange:4pcs
I wanted to do something like allowing user input for example user search "mango" I want the system to print out
Please enter the fruit name : mango >> this is user input
Desire Output
Fruit Shape : Oval
Fruit Color : Yellow
Fruit Quantity : 18pcs
So far this is what i done and it could only print out the entire line of strings, did i do something wrong here?
echo -n "Please enter the fruit name :"
read fruitName
awk '/'$fruitName'/ {print}' textFileA
Current Output
mango:oval:yellow:18pcs