> shell编程 >

去除文件内容中的注释与空行的命令

去除文件内容中的注释与空行:


cat file |sed -e '/^$/d' -e '/^#/d'

cat file |sed -n -r '/^$|#/!p'
(责任编辑:IT)