シェルスクリプトを使用してecho >
データを送信し$outputfile
ていますが、以前のデータを含む古いファイルが常にあります$oldouptdata
。私がする必要があるのは次のとおりです。
echo "datahereto" > $ouptputfile
read $oldouptdata
diff $ouptputfile $olouptdata
if there is a difference then execute function (myfunction) then replace $oldoutputdata data with $outputfile data
これは私のシナリオです。それで何か助けはありますか?