
これを実行する代わりに、bash で base64 でエンコードされたファイルをソースする方法はありますか?
cat $DIR/data/saves/$savegame | base64 --decode > $DIR/data/saves/$savegame.decoded
. $DIR/data/saves/$savegame.decoded
rm $DIR/data/saves/$savegame.decoded > /dev/null
答え1
Base64 でエンコードされた BLOB が安全であると確信できる場合にのみ、次の操作を実行します。
$ cat test.b64
ZWNobyAidGhpcyBpcyBhIHRlc3QiCg==
$ base64 -D test.b64
echo "this is a test"
$ . <(base64 -D test.b64)
this is a test