1
コマンドを文字列として返す関数があります。このコマンドを実行せずに次のプロンプトに文字列として渡すにはどうすればいいですか?例えばzshで定義済みのコマンド文字列で次のプロンプトを開始
:文字列としてcd ~/some_dir/
を返しcommandGenerator
機能。今、私は自分の端末内にcommandGenerator
を実行します。ビルトインprint
コマンドに
> commandGenerator
> cd ~/some_dir/
^
Cursor position after execution of commandGenerator.
I can now edit the command or hit enter to execute it.