I usually zsh
. I want to execute a function in bash and return back to my original shell. I can do this manually, but I want to automate it. How can I do that?
For example, I am on zsh.
I want to execute func
, which is a function()
in bigscript.sh
file. I am sourcing the bigscript.sh
file in my .zshrc
I tried adding shebang #!/bin/bash
in the bigscript.sh
file, but that does not change the shell.
I tried another approach of putting function
in a standalone function.sh
file and added shebang to it. It worked. However, I do not want to break the files into smaller .sh
files.
So, any suggestions on changing the shell for a single function..?
bash
to take input from a "here-document". I haven't used this inzsh
, but the facility seems to be much the same as inbash
.