[R-pkg-devel] Dialect for shell scripts
Rodrigo Tobar
rtobar at icrar.org
Fri Dec 15 09:20:21 CET 2017
Hi all,
I'm just bumping this up in case somebody can shed any light on it --
otherwise I will try again to submit this question to r-devel.
Regards,
Rodrigo
On 12/12/17 06:56, Rodrigo Tobar wrote:
> Dear all,
>
> During a recent package submission, we were highlighted that some lines
> in our configure script didn't follow the correct syntax. The lines
> looked like this:
>
> x=$(($y/10))
>
> We were indicated at the time that this is because the statement does
> not use Bourne shell syntax, which is absolutely true, and also that the
> manual warns about this, which is true again. So far everything is clear.
>
> However, what confuses me is that even when the manual says that "you
> can include an executable (Bourne) shell script configure in your
> package" [1], the associated footnote says something slightly different:
> "The script should only assume a POSIX-compliant /bin/sh" [2]. The
> footnote goes even further, and links to the POSIX specification of the
> Shell Command Language [3] (as published by The Open Group), which
> explicitly includes arithmetic expressions like the one above in its
> syntax [4].
>
> My question then is: what exact dialect should be considered? Given that
> the statement above does not work in the Bourne shell, I conclude that
> the Bourne shell is not POSIX-compliant. That in turn would make the
> manual ambiguous as to the precise dialect that should be used by our
> configure scripts, and either the shells used by R should be changed to
> be POSIX-compliants, or the manual edited to be more precise regarding .
>
> Many thanks.
>
> Rodrigo
>
> [1]
> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Configure-and-cleanup
> [2] https://cran.r-project.org/doc/manuals/r-release/R-exts.html#FOOT25
> [3] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
> [4]
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04
>
More information about the R-package-devel
mailing list