Why not?
[ -d /nix ] && echo ...
D=/nix test -d $D && echo $D exists …
$ V=nada echo "x${V}x" xx
Reply on news.ycombinator.com