-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1028
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
[ -e ~/.bashrc -a ( -x /bin/dash -o -x /bin/ash ) ]
In POSIX:
[ -e ~/.bashrc ] && { [ -x /bin/dash ] || [ -x /bin/ash ]; }
Obsolete XSI syntax:
[ -e ~/.bashrc -a \( -x /bin/dash -o -x /bin/ash \) ]
[
is implemented as a regular command, so (
is not special.
The preferred way is not to group inside [ .. ]
and instead compose multiple [ .. ]
statments using the shell's &&
, ||
and { ..; }
syntax, since this is well defined by POSIX.
Some shells, such as Bash, support grouping with \( .. \)
, but this is an obsolete XSI-only extension.
None