diff --git a/cookbook/foreign_shell_scripts.md b/cookbook/foreign_shell_scripts.md index 6ce9c598993..91d3a97fa04 100644 --- a/cookbook/foreign_shell_scripts.md +++ b/cookbook/foreign_shell_scripts.md @@ -63,6 +63,19 @@ This quickly gets tricky though, for example when the script is declaring a There are ways to implement some form of expansion too, but at some point it might make more sense to leave the parsing to the shell it was meant for. +## Bash Env Plugin + +There is a third-party Nu plugin [bash-env](https://github.com/tesujimath/nu_plugin_bash_env) +for importing environment variables from Bash format files and pipes. +This plugin uses Bash itself to parse the environment definitions, +and can therefore cope with arbitrarily complex Bash sources. + +::: warning +Please note that the `bash-env` plugin is not supported by the core Nushell team. +All issues and requests for support should be directed to its own +[issue tracker](https://github.com/tesujimath/nu_plugin_bash_env/issues). +::: + ## Capturing the environment from a foreign shell script A more complex approach is to run the script in the shell it is written for and diff --git a/cookbook/ssh_agent.md b/cookbook/ssh_agent.md index bee5e78eb52..3dd4acb9803 100644 --- a/cookbook/ssh_agent.md +++ b/cookbook/ssh_agent.md @@ -21,6 +21,18 @@ Adding this to your `env.nu` will however start a new ssh-agent process every ti See the workarounds. ::: +Alternatively, use the third-party Nu plugin [bash-env](https://github.com/tesujimath/nu_plugin_bash_env) as follows. + +```nushell +^ssh-agent | bash-env | load-env +``` + +::: warning +Please note that the `bash-env` plugin is not supported by the core Nushell team. +All issues and requests for support should be directed to its own +[issue tracker](https://github.com/tesujimath/nu_plugin_bash_env/issues). +::: + ## Workarounds You can work around this behavior by checking if a ssh-agent is already running on your user, and start one if none is: