On Sat, Apr 14, 2018 at 06:03:29PM -0700, Philip Guenther wrote:
> On Sun, 15 Apr 2018, Martijn Dekker wrote:
> > $ ksh -c 'trap "" CONT; trap'
> > trap --  CONT
> > 
> > That is not "suitable for re-entry into the shell". Empty words must be
> > quoted, or they disappear. Expected output:
> > 
> > trap -- '' CONT
> > 
> > Patch below. OK?
> 
> That also changes the output of set, export, and alias:
> 
> : morgaine; ksh -c 'alias foo=""; alias -p; export foo=; set; export -p' | 
> grep foo
> alias foo=
> foo=
> export foo=
> : morgaine; obj/ksh -c 'alias foo=""; alias -p; export foo=; set; export -p' 
> | grep foo
> alias foo=''
> foo=''
> export foo=''
> : morgaine;
It also badly effects non-empty cases:

        $ ksh -c alias
        autoload='typeset -fu'
        functions='typeset -f'
        hash='alias -t'
        history='fc -l'
        integer='typeset -i'
        local=typeset
        login='exec login'
        nohup='nohup '
        r='fc -s'
        stop='kill -STOP'
        type='whence -v'
        $ ./obj/ksh -c alias
        autoload=''
        functions=''
        hash=''
        history=''
        integer=''
        local=''
        login=''
        nohup=''
        r=''
        stop=''
        type=''

Reply via email to