17
どうすればいいですか?テキストを変数に置き換えます
sed -i 's/wiki_host/$host_name/g' /root/bin/sync
それはテキスト$host_name
とwiki_host
に置き換えられます。 しかし、私はそれはどちらか動作しません
sed -i 's/wiki_host/${host_name}/g' /root/bin/sync
でそれを試してみました
..変数の内容とそれを交換したいです。
これを確認してください:http://theunixshell.blogspot.com/2013/04/replace-string-in-file-with-value-in.html – Vijay