Quantcast
Channel: Active questions tagged fish - Stack Overflow
Viewing all articles
Browse latest Browse all 106

In fish shell, how to set a variable with default fallback?

$
0
0

I'm looking for the equivalent of the following bash syntax, but for the fish shell:

local datafile="${_Z_DATA:-$HOME/.z}"

i.e define a local variable that will take the value of $_Z_DATA if this one is define, or else will take the value of $HOME/.z


Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>