| To: | austin-group-l@xxxxxxxxxxxxx |
|---|---|
| Subject: | Re: shell, arithmetic expansion and integer constants |
| From: | Roger Marquis <marquis@xxxxxxxxx> |
| Date: | Tue, 17 Jun 2008 07:49:02 -0700 (PDT) |
| References: | <20080617140716.GN10734@prunille.vinc17.org> |
Vincent Lefevre wrote: $ echo $((x)) sh: 1+: syntax error: operand expected (error token is "+") That's bash syntax, but the error indicates Bourne sh. Bourne is a standard across Unix/Linux OS whereas bash is, well, bash comes several versions. Roger Marquis PS. Where is the online POSIX Bourne shell spec? PPS. Common syntax must retain backwards compatibility. It was difficult enough having to add LANG=C and _POSIX2_VERSION=199209 to dozens of scripts after the syntax for sort was changed (without adequate involvement of the sysadmin community IMO) just to be able to sort by syslog datestamps. Date sorting is one of the most common sort usages, but was left out of the POSIX spec, and dropped wholesale by GNU implementations. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | shell, arithmetic expansion and integer constants, Vincent Lefevre |
|---|---|
| Next by Date: | Re: shell, arithmetic expansion and integer constants, David Korn |
| Previous by Thread: | shell, arithmetic expansion and integer constants, Vincent Lefevre |
| Next by Thread: | Re: shell, arithmetic expansion and integer constants, Stephane Chazelas |
| Indexes: | [Date] [Thread] [All Lists] |