Sample Header Ad - 728x90

Can a bash script add to the context of zsh?

-1 votes
1 answer
298 views
I have recently migrated from bash to zsh. I used to use the following token_refresh.sh script to ssh-add my private key to the session: #!/usr/bin/env bash echo "configuring ssh access.." eval "$(ssh-agent -s)" ssh-add ./my-key However, I can't run this directly from zsh in the dir /ssh: $ ls my-key my-key.pub token_refresh.sh $ . token_refresh.sh .: no such file or directory: token_refresh.sh I can run bash scripts using bash token_refresh.sh However, doesn't that start a bash session, ssh-add the key to the bash session, then exits. How can I portably run this script in bash and zsh?
Asked by StuperUser (183 rep)
May 15, 2023, 10:26 AM
Last activity: May 15, 2023, 11:23 AM