Parsing simple command function bodies

2017-03-26 Thread Dan Douglas
Have function defs always taken arbitrary commands? $ mksh -c 'fun() echo fun; fun; typeset -p KSH_VERSION' fun typeset -r KSH_VERSION='@(#)MIRBSD KSH R54 2017/03/21' $ ssh ormaajdroid "/system/bin/sh -c 'fun() echo fun; fun; typeset -p KSH_VERSION'" fun typeset -r

Re: Parsing simple command function bodies

2017-03-26 Thread Dan Douglas
On 03/26/2017 07:16 PM, Thorsten Glaser wrote: > * sh and AT ksh allow any command, go with the later since it > * shouldn't break anything. Heh sure enough, AT ksh too. Can't believe I didn't notice it. Yeah I guess if it doesn't break anything it's fine... I can't think of any real problems.

Re: Unsetting local variables

2017-03-17 Thread Dan Douglas
On 03/17/2017 12:07 PM, Stephane Chazelas wrote: > Dan is describing what I can only explain as a bug or at least a > very surprising feature: The way Chet has described it in the past it sounded like an intentional compromise to make outer scopes accessible without the also possibly surprising

Re: Unsetting local variables

2017-03-16 Thread Dan Douglas
On 03/14/2017 05:08 AM, Jean Delvare wrote: > So internally bash does make a difference between a variable being > null and a variable being unset. A bash variable can actually have 4 > distinct states: non-existent, existent but unset, set but null, and > non-null. "typeset", "local" and "unset"