1
我想用使用shell腳本寫在括號中的數據替換空格。 我的輸入線是如何使用shell腳本在括號內的數據中用「_」替換空格?
2012-05-21六點37分16秒中號NumberOfHwEntitiesMismatch櫃= 1
我希望我的輸出爲(SAU未配置檢測出。):
2012-05-21 6時37分16秒中號NumberOfHwEntitiesMismatch櫃= 1 (SAU_that_is_not_configured_detected。)
請建議我的東西....
非常感謝,這是一個很大的幫助 – Anand
嗨羅布麻 請給我解釋一下這個命令 awk -F \('{gsub(「,」_「,$ 2); print $ 1」(「$ 2}' – Anand
首先,'-F \('告訴awk使用'('作爲字段分隔符。 'gsub'函數用第二個字段中的下劃線替換空格字符,最後打印出第一個和第二個字段。 – dogbane