file1 には以下が含まれます。
first=stan
last=smith
を含むfile2を作成したい
first=homer
last=simpson
script.sh が含まれています
#!/bin/bash
sed s/stan/$1/ file1 >tempfile
sed s/smith/$2/ tempfile >file2
rm tempfile
script.sh ホーマー・シンプソンは私のやりたいことをやってくれます。
一時ファイルを作成および削除せずに bash スクリプトでこれを行うより良い方法はありますか?