Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-12 Thread John Kearney
Am 13.01.2013 00:04, schrieb Chet Ramey: > On 1/12/13 10:07 AM, John Kearney wrote: > >> regarding -e it mainly has a bad name because there is no good guide how >> to program with it. >> so for example this causes stress >> [ ! -d ${dirname} ] && mkdir ${dirname} >> because if the dir exists it wi

Re: Some segfaults possible via mapfile callbacks

2013-01-12 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/9/13 1:49 PM, Dan Douglas wrote: > Hi. These were easy for me to reproduce in various versions. > > Export to mapfile the variable to be assigned, then run any callback: > $ printf '%s\n' {a..z} | bash -xc 'a= mapfile -tc1 -C : a' > +

Re: Assignment errors with no additional words expanded in non-POSIX mode fails to abort

2013-01-12 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/11/13 1:17 PM, Dan Douglas wrote: > Whether or not this type of error aborts depends upon there being an actual > newline. It doesn't actually abort the script itself; the assignment error causes the current command to be aborted. Posix mode do

Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-12 Thread Chet Ramey
On 1/12/13 10:07 AM, John Kearney wrote: > regarding -e it mainly has a bad name because there is no good guide how > to program with it. > so for example this causes stress > [ ! -d ${dirname} ] && mkdir ${dirname} > because if the dir exists it will exit the scripts :) I'm not sure this is what

Re: printf %q represents null argument as empty string.

2013-01-12 Thread John Kearney
Am 12.01.2013 20:40, schrieb Chet Ramey: > On 1/12/13 9:48 AM, John Kearney wrote: > >> anyway now we have a point I disagree that >> "${@}" >> >> should expand to 0 or more words, from the documentation it should be 1 >> or more. At least that is how I read that paragragh. IT says it will >> spli

Re: printf %q represents null argument as empty string.

2013-01-12 Thread Chet Ramey
On 1/12/13 9:48 AM, John Kearney wrote: > anyway now we have a point I disagree that > "${@}" > > should expand to 0 or more words, from the documentation it should be 1 > or more. At least that is how I read that paragragh. IT says it will > split the word not make the word vanish. > so I had t

Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-12 Thread John Kearney
Am 12.01.2013 14:53, schrieb Dan Douglas: > Yes some use -u / -e for debugging apparently. Actual logic relying upon > those > can be fragile of course. I prefer when things return nonzero instead of > throwing errors usually so that they're handleable. ah but you can still do that if you want

Re: printf %q represents null argument as empty string.

2013-01-12 Thread John Kearney
Am 12.01.2013 15:34, schrieb Dan Douglas: > On Friday, January 11, 2013 10:39:19 PM Dan Douglas wrote: >> On Saturday, January 12, 2013 02:35:34 AM John Kearney wrote: >> BTW, your wrappers won't work. A wrapper would need to implement format > Hrmf I should have clarified that I only meant A comp

Re: printf %q represents null argument as empty string.

2013-01-12 Thread Dan Douglas
On Friday, January 11, 2013 10:39:19 PM Dan Douglas wrote: > On Saturday, January 12, 2013 02:35:34 AM John Kearney wrote: > BTW, your wrappers won't work. A wrapper would need to implement format Hrmf I should have clarified that I only meant A complete printf wrapper would be difficult. A sing

Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-12 Thread Dan Douglas
Yes some use -u / -e for debugging apparently. Actual logic relying upon those can be fragile of course. I prefer when things return nonzero instead of throwing errors usually so that they're handleable. -- Dan Douglas