Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 546634 - app-shells/dash: $(()) behaves differently from bash
Summary: app-shells/dash: $(()) behaves differently from bash
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://thread.gmane.org/gmane.comp.st...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 22:35 UTC by SpanKY
Modified: 2015-07-09 10:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2015-04-14 22:35:29 UTC
noticed via lsof:
$ dash -c 'echo $(())'
dash: 1: arithmetic expression: expecting primary: ""
$ bash -c 'echo $(())'
0
$ busybox ash -c 'echo $(())'
0

not sure if this behavior is mandated by POSIX.  need to ask on their mailing lists.  the relevant part of the spec:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_01
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01
Comment 1 SpanKY gentoo-dev 2015-07-09 10:23:09 UTC
after discussion on POSIX lists, looks like both behaviors are acceptable