不,真的,如何检查ssh-agent是否已在bash中运行?
到目前为止,答案似乎并未回答原始问题…
这对我有用:
if ps -p $SSH_AGENT_PID > /dev/nullthen echo "ssh-agent is already running" # Do something knowing the pid exists, i.e. the process with $PID is runningelseeval `ssh-agent -s`fi

到目前为止,答案似乎并未回答原始问题…
这对我有用:
if ps -p $SSH_AGENT_PID > /dev/nullthen echo "ssh-agent is already running" # Do something knowing the pid exists, i.e. the process with $PID is runningelseeval `ssh-agent -s`fi