概要:ノード内のテキストを毎週自動的に変更する Bash スクリプトを作成する必要があります。スクリプトはノードに一致し、その中のテキストを置き換えますか (可能な場合)? どうすればいいですか?
長い要約: 私は、/ShowcaseStandalone/ffs-storage/ ディレクトリに独自の .xml ファイルを持つショップを持つ Minecraft サーバーをホストしています。毎週日曜日に、サーバーが再起動し、端末に対していくつかのコマンドを実行して、いくつかのことをリセットします。私が変えようとしているのは、あるお店です。ノード <itemstack> のテキストとノード <price> のテキストを変更したいと考えています。別のフォルダーにある .txt ファイルからテキストを取得し、そのノードに挿入したいだけです。問題は、ノード内のテキストが毎週変わることです。bash を使用して 2 つのノード内の特定の行またはテキストを置き換える方法はありますか?
XML ファイル:
<?xml version="1.0" encoding="UTF-8"?>
<scs-shop usid="cac8480951254352116d5255e795006252d404d9" version="2" type="storage">
<enchantments type="string"/>
<owner type="string">Chadward27</owner>
<world type="string">Frisnuk</world>
<itemStack type="string">329:0</itemStack>
<activity type="string">BUY</activity>
<price type="double">55.0</price>
<locX type="double">487.5</locX>
<locY type="double">179.0</locY>
<locZ type="double">-1084.5</locZ>
<amount type="integer">0</amount>
<maxAmount type="integer">0</maxAmount>
<isUnlimited type="boolean">true</isUnlimited>
<nbt-storage usid="23dffac5fb2ea7cfdcf0740159e881026fde4fa4" version="2" type="storage"/>
</scs-shop>
オペレーティング システム: Linux Ubuntu 12.04