Running either of these commands seems to start an SSH agent process successfully:
eval `ssh-agent`
OR
exec ssh-agent bash
I'm partial to the first one, because the second exec
replaces the shell. Obviously the second, uses eval
which is frowned upon by some, but I don't see alternatives.
My questions are:
- Does
exec
have any negative side effects when replacing the shell or indeed any side effects at all? Are my concerns about usingexec
warranted? - I don't have an issue using
eval
but, out of interest what alternative commands are there without scripts or functions (and withoutexec
oreval
) to start an ssh-agent process in one line?