dimanche 24 mars 2019

fish: if error: `[: Missing argument at index 2`

I am a first-time Fish user and curently I try to convert my Bash prompt (PS1) to fish_prompt, which I save to ~/.config/fish/functions/fish_prompt.fish.

This is a similar problem as this, however, the solution does not work for me.

I tried to remove the [], use test, however, I have no idea how to compare strings in Fish

if [ $prompt_hostname == 'remote-host' ]
    set userHost remote
else
    set userHost local
end

Aucun commentaire:

Enregistrer un commentaire