From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24904 invoked by alias); 24 Mar 2013 04:46:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17734 Received: (qmail 26432 invoked from network); 24 Mar 2013 04:46:45 -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=-3.3 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=rX97bvfS8lDGiEl1dnaTc4rXd/af4aMggVidnOKoszU=; b=lARJDXPira+zBZ968q4wj+2GjxXNd6Oo+yUxB7cw7/v8X9z0mdvpubHbVqXrD7JgbAq1PRSJ2WIt+rk5V9ROea2s527WtVib9ftPKKzPOoOF+PHCfyVU29V2KQzUl44FIr8JGOyhAQ1oXu8tUifeNu82g2IPnvklGo5y40BUzp0=; Date: Sun, 24 Mar 2013 00:46:41 -0400 From: Phil Pennock To: TJ Luoma Cc: Zsh-Users List Subject: Re: why isn't IFS=$'\n' doing what I expect it to do here? Message-ID: <20130324044640.GA73632@redoubt.spodhuis.org> Mail-Followup-To: TJ Luoma , Zsh-Users List References: <20130324030938.GA70966@redoubt.spodhuis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2013-03-23 at 23:27 -0400, TJ Luoma wrote: > > Similarly, you can use: > > APPS=(${=${:-' > > for the first line, to actually split on $IFS, in which case changing > > IFS does affect parsing here. > > > > -Phil > > > > If I do that then I can no longer use "$f[5]" to refer to the 5th _line_ … > I end up getting a single character instead of a line. Then something is strange in your environment. The (f) forces splitting on lines, resulting in an array, and is assigned inside APPS=( ... ). Similarly for the = (which uses $IFS to split). I've just confirmed with "zsh -f" that this works just fine with default options. I suspect that you missed the outer ${(f) ... } wrapper. -Phil