bashrun
Synopsis
Section titled “Synopsis”bashrun [--] <code>Description
Section titled “Description”Runs a snippet of Bash code in a child bash attached to the terminal, so output streams live and interactive programs work, then carries its exported-variable changes and its final directory back into the current Fish session. Unlike replay, nothing is buffered, but Bash aliases and functions are not carried back.
Enter calls this automatically for a command line that Fish cannot parse but Bash can (see __bashrun_execute), rewriting the line to bashrun ‘<code>’ first so the history entry shows what actually ran.
Bash’s $? starts as the status of the Fish command run just before.
Arguments
Section titled “Arguments”code |
Bash code to run; several arguments are joined with spaces |
-h, --help |
Show usage help (only as the sole argument) |
Exit Status
Section titled “Exit Status”The exit status of the Bash code 2 No code given, an unknown option, or bash is not installed
Example
Section titled “Example”bashrun 'for f in *.log; do gzip "$f"; done'bashrun 'export FOO=bar; cd /tmp'Classification: bypasses-shadow(bash)