Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(( arithmetic expressions )) for ksh a Linux flavor #3063

Open
2 of 4 tasks
LerouxYvon opened this issue Sep 25, 2024 · 0 comments
Open
2 of 4 tasks

(( arithmetic expressions )) for ksh a Linux flavor #3063

LerouxYvon opened this issue Sep 25, 2024 · 0 comments

Comments

@LerouxYvon
Copy link

For bugs

  • Rule Id (if any, e.g. SC1000): SC1073, SC1009, SC1072
  • My shellcheck version (shellcheck --version or 'online'): online
  • I tried on shellcheck.net and verified that this is still a problem on the latest commit
  • It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/bin/ksh
(( X_NB_JOURS = round(X_NB_JOURS) ))

Here's what shellcheck currently says:

Line 2	SC1073: Couldn't parse this ((..)) command. Fix to allow more checks.
Line 2	SC1009: The mentioned syntax error was in this ((..)) command.
Line 2	SC1072:  Fix any mentioned problems and try again.

Here's what I wanted or expected to see:

TODO: Describe expected/desired output
Send a warning that the expression is not a "legitimate POXIS Arithmetic expression" or a "Linux flavor".
To me, "syntax error " is a very scary error.

Here are all arithmetics functions accepted on Linux KSH93.

abs acos acosh asin asinh atan atan2 atanh cbrt
copysign cos cosh erf erfc exp exp2 expm1 fabs
fdim finite floor fma fmax fmod hypot ilogb
int isinf isnan lgamma log log2 logb
nearbyint nextafter nexttoward pow remainder
rint round sin sinh sqrt tan tanh tgamma trunc

Check documentation:
https://docs.oracle.com/cd/E36784_01/html/E36870/ksh-1.html

Thank you so much for this excellent tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant