textFileA包括:
mango:oval:yellow:18pcs
apple:irregular:red:12pcs
orange:round:orange:4pcs
我想做一些事情,比如允许用户输入,比如用户搜索"芒果"
请输入水果名称:mango>>;这是用户输入
Desire Output
Fruit Shape : Oval
Fruit Color : Yellow
Fruit Quantity : 18pcs
到目前为止,这就是我所做的,它只能打印出整行字符串,我在这里做错了什么吗?
echo -n "Please enter the fruit name :"
read fruitName
awk '/'$fruitName'/ {print}' textFileA
Current Output
mango:oval:yellow:18pcs