echo 'which line number would you like to delete'
read lineNum
sed -i '"$lineNum"d' speciesDetails.txt
有人可以建議我如何使用 sed 中的變數來洗掉行號嗎?這是目前我所擁有的,但它不起作用
uj5u.com熱心網友回復:
變數不在單引號內展開。你應該只使用雙引號。使用花括號從d命令中分隔變數。
sed -i "${lineNum}d" speciesDetails.txt
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/312474.html
