使用Sed抽取MySQL安装文档的目录及行号

sed -nr  -e '/^2.|^shell/=' -e '/^2.|^shell/p' INSTALL-SOURCE |awk '{if (NR%2==1) x=$1; else printf "%d %s ",x,$0}'>INSTALL-directory.txt

原文地址:https://www.cnblogs.com/Clisa/p/3467186.html