bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print non-readonly variables with declare +r -p


From: Dan Douglas
Subject: Re: Print non-readonly variables with declare +r -p
Date: Wed, 14 Dec 2011 15:10:02 -0600
User-agent: KMail/4.7.3 (Linux/3.1.4-pf+; KDE/4.7.3; x86_64; ; )

On Wednesday, December 14, 2011 10:57:21 AM Chet Ramey wrote:
> On 12/13/11 3:13 PM, Dan Douglas wrote:
> > I imagine this is ok because Bash's declare -p is intended to be human-
> > readable only, whereas Ksh guarantees -p produces output in a format
> > reusable as input.
> 
> Bash's `declare -p' output is intended to be reusable as input, though the
> documentation doesn't make that explicit.

Ah. I had assumed the single quotes added around array compound asssignment 
broke this (intentionally?), but now I see it's valid. I expected declare -a 
y='([0]="a" [1]="b c" [2]="d")' to set the first element of y to that entire 
string.

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]