昨天花了一下午的時間,終於搞定了sed多行的問題,開心!

ok.sh:

--------------------------------------------------------------------------------------------------------------------------------------------

#sed "/^/[tool_path/][ /t]*/N;s/^/[tool_path/][ /t/n]*.*$//[tool_path/]/n//usr//bin//arm-linux-/" tools.cfg

TOOL=${TOOL:=/usr/bin/arm-linux-}

echo TOOL = $TOOL

TOOL1=`echo $TOOL |sed 's///////////g'`

sed '/^/[tool_path/][ /t]*/N;s/^/[tool_path/][ /t/n]*.*$//[tool_path/]/n'${TOOL1}'/' tools.cfg

-------------------------------------------------------------------------------------------------------------------------------------------- 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章