问题如下:
solaris:~/src/brk$ cat .file
one xxx 123
two yyy 123
three bbb 321
four xyz 123
脚本:
solaris:~/src/brk$ cat scr.sh
...
PATH="dist/"
LINE=$(awk '/^[ \t]*$/{next} /^[ \t]*#/{next} {printf $2" "}' .file)
echo "LINE=$LINE"
...
输出:
xxx yyy bbb xyz
我想要以下输出:
dist/xxx dist/yyy dist/bbb dist/xyz
如何修改 awk 表达式以获得所需的输出?