I'd like to use keychain with the fish shell, but I'm not sure how to get fish to load the ~/.keychain/hostname-fish file to set the appropriate environment variables.
In bash, there's the "source" command, but it doesn't exist in fish.
Below is what I have in ~/.config/fish/config.fish for your specific example.
set -gx HOSTNAME (hostname)
if status --is-interactive;
keychain --nogui --clear ~/.ssh/id_rsa
[ -e $HOME/.keychain/$HOSTNAME-fish ]; and . $HOME/.keychain/$HOSTNAME-fish
The source command is ., which also works in bash.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
5 years ago
3 months ago