我正在学习UNIX编码。我有一个文本文件,有各种描述和指定的路径。
我执行以下命令:
fgrep ${PWD:16:100}/description ../../PA1/descriptions.txt -A2
这回报:
==> ./buttonRoom/description <==
Maze button room
You are in a maze of twisty little passages, all alike.
如何排除==> ./buttonRoom/description <==
行?
将此添加到初始grep:
| grep -v '==>'
或者直接删除第一行:
| sed '1d'