以下是我的代码:
#!/bin/ksh -p
NAME=$1
echo $NAME likes to drink:
grep $NAME ~/practice/database/likes
echo total number of beers $NAME likes to drink:
grep $NAME ~/practice/database/likes | wc -l
以下是我的输出:
dave likes to drink:
dave,coors
dave,bud
total number of beers dave likes to drink:
2
我如何只输出“coors”和“bud”?