Skip to content

Commit

Permalink
add comments on things flagged by checkbashisms
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87539 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Jan 8, 2025
1 parent 533ae9a commit d8a7f9a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions doc/manual/R-exts.texi
Original file line number Diff line number Diff line change
Expand Up @@ -5015,10 +5015,21 @@ which is @command{bash}-specific (first set the variable then export it
by name).

Using @code{test -e} (or @code{[ -e ]}) in shell scripts is not fully
portable@footnote{it was not in the @I{Bourne} shell, and was not supported
by Solaris 10.}: @code{-f} is normally what is intended. Flags
@option{-a} and @option{-o} are nowadays declared obsolescent by POSIX
and should not be used.
portable@footnote{it was not in the @I{Bourne} shell, and was not
supported by Solaris 10.}: @code{-f} is normally what is intended.
Flags @option{-a} and @option{-o} are nowadays declared obsolescent by
POSIX and should not be used. They are easily replaced by more legible
forms: replace
@example
test A -a B
test A -o B
@end example
@noindent
by
@example
test A && test B
test A || test B
@end example

Use of `brace expansion', e.g.,
@example
Expand All @@ -5027,6 +5038,9 @@ rm -f src/*.@{o,so,d@}
@noindent
is not portable.

The string equality operator in shell tests is @code{=} : @code{==} is
a GNU extension.

The @option{-o} flag for @command{set} in shell scripts is optional in
POSIX and not supported on all the platforms @R{} is used on.

Expand Down

0 comments on commit d8a7f9a

Please sign in to comment.