Search code examples
shellfish

how to pass content of file variable in fish shell


I want to use the .pem for secure ssh connection so how can I pass the content of the pem to a variable in fish script?

set key /Users/mesutgunes/project/mproject-key.pem
ssh -i (cat $key) labs[1] ???

Solution

  • Set environment value.

    set file /Users/mesutgunes/project/mproject-key.pem
    ssh -i $file host
    

    regards