-R VAR (conditional operator)
true
if the shell variable VAR
is set and is a name.
-R
is not included in POSIX.1-2017.
Links
Examples
- Different ways to test if a shell variable is set and is a name:
1 2 3 4
test -R var && echo "set" [ -R var ] && echo "set" # Bash [[ -R var ]] && echo "set"
BashSupport Pro 是一个 支持 -R 的 Bash 集成开发工具 – 马上试用!