嗨我有這個問題。linux在字符串匹配前插入文件內容
我有一個原始文件:
$cat original.txt
User has access to the system
和我要添加到原文件內容的第二檔:
$cat toAdd.txt
Anna
結果應該如下:
$cat original.txt
User Anna has access to the system
我嘗試了幾個選項,如:
sed '/has/e cat toAdd.txt' original.txt
,但它不工作:-(
請幫助!
建議的解決方案不會在這種情況下工作。 – MrTeleBird 2014-10-09 10:57:46
解釋爲什麼建議的解決方案無法正常工作! – 2014-10-09 11:44:44