rush
rush copied to clipboard
User defined shell functions
Prerequisites
- [x] make sure you're are using the latest version by
rush -V
rush v0.5.0
Checking new version...
You are using the latest version of rush
- [x] read the usage (rush -h) and examples
Describe your issue
I'm trying to use rush from within a shell script with a user defined bash function, but am getting the command not found: XYZ
error.
test.sh
#!/bin/bash
run() {
echo $1
}
seq 5 | rush run {}
>>> ./test.sh
zsh:1: command not found: run
zsh:1: command not found: run
18:01:27.372 [ERRO] wait cmd #3: run 3: exit status 127
zsh:1: command not found: run
18:01:27.372 [ERRO] wait cmd #4: run 4: exit status 127
18:01:27.373 [ERRO] wait cmd #2: run 2: exit status 127
zsh:1: command not found: run
zsh:1: command not found: run
18:01:27.373 [ERRO] wait cmd #1: run 1: exit status 127
18:01:27.374 [ERRO] wait cmd #5: run 5: exit status 127
- [x] describe the problem
- [x] provide a reproducible example
Export the function or use ‘set -a’ command at the beginning of the code
Thanks @sakyb7. I also had to set SHELL=/bin/bash because my default shell was fish