Problem:
I've got a script that generates an ssh command string to generate an ssh session to a remote shell. I want to run this like the following:
function_name args | bash
However it executes the ssh command in a subshell (apologies if that's the wrong terminology) and I can't then use it.
What's the correct way to run this so it executes in the same shell, and I can then write into that shell?
Aside:
For those who wanted the function, it's:
function shortcut_for_ssh(){
grep ssh notesfile | grep $1
}
Yields
ssh user@hostname
Source it.
. <( function_name args )
That or an exec
or something like it.
I will assume you trust the function ...