替换:(s)
sed -i 's/.*shutdown=.*/<Server port="8006" shutdown="SHUTDOWN">/' server.xml
sed -i 's/.*protocol="AJP\/1.3".*/<Connector port="8008" protocol="AJP\/1.3" redirectPort="8443" \/>/' server.xml
sed -i 's/.*org.apache.coyote.http11.*/<Connector port="8445" protocol="org.apache.coyote.http11.Http11Protocol"/g' server.xml
sed -i 's/connectionTimeout="$timeoutold"/connectionTimeout="$timeoutnew"/' server.xml
打印:(p)
sed -n '/connectionTimeout=/p' server.xml | awk '{print $1}' | head -1