News for hackers. Stuff that matters.
Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by chasil on Tuesday June 20, 2023 @06:48PM (#36411799)
I am on OpenBSD 7.2, and I see:

  $ eval $(ssh-agent)
  Agent pid 56785

  $ ssh-agent -k
  unset SSH_AUTH_SOCK;
  unset SSH_AGENT_PID;
  echo Agent pid 56785 killed;
The correct processing of that output requires an eval.

Did you have any other questions?

Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by pmarreck on Tuesday June 20, 2023 @08:09PM (#36412560)
Why do you need to eval it?

$(ssh-agent)

won’t substitute that with the stdout and run that?

Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by chasil on Tuesday June 20, 2023 @08:35PM (#36412789)
Because the intended use for "ssh-agent -k" is for eval.

While redirecting to /dev/null will certainly work, the agent is holding sensitive credentials (by design), and confirmation of shutdown has a tangible security benefit.