From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12723 invoked by alias); 16 Dec 2013 19:40:31 -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: 32135 Received: (qmail 21336 invoked from network); 16 Dec 2013 19:40:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131216114013.ZM25877@torch.brasslantern.com> Date: Mon, 16 Dec 2013 11:40:13 -0800 In-reply-to: Comments: In reply to Oystein Walle "Read-only variables in emulation mode" (Dec 16, 8:10pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Oystein Walle , zsh-workers@zsh.org Subject: Re: Read-only variables in emulation mode MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 16, 8:10pm, Oystein Walle wrote: } Subject: Read-only variables in emulation mode } } I assume status and _ are meant to be writable in POSIX shells. Hmm. According to the doc, "status" should be writable but "_" not. status _ (The means "special", the means "but only in native zsh mode".) } A common idiom in (ba)sh scripting is to use _ as a throwaway in a } while-read loop: } } while read -r col1 _ col2; do } echo "col1 = $col1 and col2 = $col2" } done < three-columns.txt Well, that's one I'd never seen before. Certainly that's about the only place it's "safe" to use "_" because it's always immediately going to be clobbered. } In the mean time, is there any way around it? Only by using a function scope and declaring "local -h _ status" to hide the special variables.