Sourceコマンドを使用する代わりにbashスクリプトを呼び出す簡単な方法

Sourceコマンドを使用する代わりにbashスクリプトを呼び出す簡単な方法

私のスクリプトはシェル変数を使用して変更します。常に以下を使用する必要があります。

source myscript

このスクリプトを呼び出して現在のシェル環境を変更するより短い方法はありますか?

これは、次に説明する関数を使用してエレガントに実行できます。この回答しかし、より速い方法が必要です。

ベストアンサー1

使用できる.略語ですsourcebash(1)マニュアルページから:

.  filename [arguments]
source filename [arguments]

Read and execute commands from filename in the current shell environment and return
the exit status of the last command executed from filename.

おすすめ記事