我努力了
#!/bin/bash
distro=""
myvar1=[[ -n "$distro" ]] && echo $distro || echo "debian"
myvar2=$((-n $distro ? $distro : "debian"))
这些是脚本的结果
./build.sh: line 5: -n: command not found
debian
./build.sh: line 6: -n ? : debian: expression expected (error token is ": debian")