On Fri, May 30, 2014 at 09:28:13PM -0500, Dan Douglas wrote:
> The problem is most people don't realize how "variables" are evaluated.
> Any time the shell needs to reference a variable, it takes a string
> like: "arr[$foo]" and, if there's an index, the string within the index
> gets processed for
Greg Wooledge writes:
> imadev:~$ : $((a[$x]))
> bash: Mon Jun 2 08:06:39 EDT 2014: syntax error in expression (error token is
> "Jun 2 08:06:39 EDT 2014")
>
> There's the code-injection problem that started the thread.
Here the index is '$(date)'.
*Note (bash) Arithmetic Expansion:: ... All t
On 6/2/14, 8:21 AM, Greg Wooledge wrote:
> On Fri, May 30, 2014 at 09:28:13PM -0500, Dan Douglas wrote:
>> The problem is most people don't realize how "variables" are evaluated.
>> Any time the shell needs to reference a variable, it takes a string
>> like: "arr[$foo]" and, if there's an index, th
On Mon, Jun 2, 2014 at 4:44 PM, Chet Ramey wrote:
> On 6/2/14, 8:21 AM, Greg Wooledge wrote:
> > On Fri, May 30, 2014 at 09:28:13PM -0500, Dan Douglas wrote:
> >> The problem is most people don't realize how "variables" are evaluated.
> >> Any time the shell needs to reference a variable, it take
On 6/2/14, 9:34 AM, Greg Wooledge wrote:
> (One could argue that POSIX's wording doesn't require the command
> substitution be done in a second pass AFTER the parameter expansion.
> But apparently it has been interpreted this way.)
Posix doesn't have arrays, and so doesn't concern itself with how
On Mon, Jun 02, 2014 at 03:08:17PM +0200, Andreas Schwab wrote:
> Greg Wooledge writes:
>
> > imadev:~$ : $((a[$x]))
> > bash: Mon Jun 2 08:06:39 EDT 2014: syntax error in expression (error token
> > is "Jun 2 08:06:39 EDT 2014")
> >
> > There's the code-injection problem that started the thread
If you want to write robust scripts, don't use shell.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
On Jun 2, 2014, at 9:34 AM, Greg Wooledge wrote:
> On Mon, Jun 02, 2014 at 03:08:17PM +0200, Andreas Schwab wrote:
>> Greg Wooledge writes:
>>
>>> imadev:~$ : $((a[$x]))
>>> bash: Mon Jun 2 08:06:39 EDT 2014: syntax error in expression (error token
>>> is "Jun 2 08:06:39 EDT 2014")
>>>
>>> Th
> From: Chet Ramey
> > The two words don't seem me to be used interchangeably in the Bash
> > manual page. "evaluate" is used only for obtaining the value of
> > "arithmetic evaluations" and "conditional expressions", whereas
> > "expand" is used for operations that are strictly textual
> > repl
The version number of Bash.
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) The hardware and
operating system.
Linux localhost 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux
The compiler used to compile Bash. A description of the bug behavi
10 matches
Mail list logo