From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20642 invoked by alias); 28 Oct 2016 21:49:03 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39753 Received: (qmail 15693 invoked from network); 28 Oct 2016 21:49:03 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(37.59.109.123):SA:0(-1.4/5.0):. Processed in 0.12909 secs); 28 Oct 2016 21:49:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at inlv.org does not designate permitted sender hosts) Subject: Re: exported unset variables [was: 'export -p' lacks POSIX output] To: Bart Schaefer , Zsh hackers list References: <9a5b08ae-f45b-d1df-9b3b-dd47a0f62412@inlv.org> <161028143156.ZM19947@torch.brasslantern.com> From: Martijn Dekker Message-ID: Date: Fri, 28 Oct 2016 22:48:57 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <161028143156.ZM19947@torch.brasslantern.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Op 28-10-16 om 22:31 schreef Bart Schaefer: > On Oct 28, 10:00pm, Martijn Dekker wrote: > } > } In zsh, however, variables are automatically set to the empty value upon > } being exported. > > That's no longer true subsequent to my "export -p" patch: > > torch% export XYZPDQ > torch% export -p | grep XYZPDQ > export XYZPDQ > torch% printenv | grep XYZPDQ > torch% > > Unless there's some other nuance here that I'm missing? Hmm... With current git version: $ PS1='%% ' Src/zsh -f -o posixbuiltins % unset -v var % export var % echo ${var+s} # this shows it as set (should be unset) s % export -p var # but this shows it as unset export var % var='' % export -p var # 'export' knows if it's set or not, ${var+s} doesn't? export var='' So, currently, ${var+s} doesn't correctly represent that an exported 'var' is unset. (Also, is it correct/expected behaviour that zsh doesn't parse comments on the interactive command line? Blindly copying/pasting the above won't work for that reason.) Thanks, - M.