摘要:
看SUSE认证的Bash脚本component.sh,刚看没几句,就发现一个关于grep的陌生用法:local biosInfo=$( hwinfo --bios )local company=$( echo "$biosInfo" | grep -m 1 -A 5 "^ System Info:"| grep -m 1 "^ Manufacturer:" | cut -d "\"" -f 2 grep -m和 -A的用法其实在grep中不常见man grep了下,看了个大概意思grep -m x &qu 阅读全文