From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22740 invoked by alias); 7 Apr 2014 15:17:23 -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: 18704 Received: (qmail 21276 invoked from network); 7 Apr 2014 15:17:18 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=s5y/kFwky7m88B4sJP/U7CwtqzU1fqt2f1whHgYUCWk=; b=q12ckrSsZKJupHhzvjMLeNTOjTkEvjfoSkBrsu7rDTPgSuFg8A8jZDVnTUU2iLllye 54QRVCQwaM1NLFilg8s4g+dV6YIg7OkmifWMxn+JvAXUVA9Y9Wty7y+XgdSu9yWKlVtl FTq7lpZvsqXXE6Q9tioxfTko+s18qiF65mEt15IqjrTY8LKUXQfvBrd0lkaIbP6vJFB2 Ih5LokJ0F0Nvki+Uo/gqOnaTFerFX9Ew8WcOk5xFQ65VNqKpIm5KFYmUH1KJ4OCI5+DD sIoUYgMiW5IzFj68r8ABqTeJVW7lfBqRKkHqfil1QmIAFwvwGWJopt9FbdnzXLIcCnlt upYg== X-Received: by 10.224.22.65 with SMTP id m1mr3055031qab.103.1396883834493; Mon, 07 Apr 2014 08:17:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: TJ Luoma Date: Mon, 7 Apr 2014 11:16:34 -0400 Message-ID: Subject: Re: Reading output into variables To: "Yuri D'Elia" Cc: Zsh-Users List Content-Type: text/plain; charset=UTF-8 I don't know of a way to split it into separate variables exactly, but you could use FOO=($(program)) and then "$FOO[1]" would be "a" and "$FOO[2]" would be b Tj On Mon, Apr 7, 2014 at 10:20 AM, Yuri D'Elia wrote: > Maybe a stupid question, but is there a way to read the output of a > program and split into variables _conveniently_ using the IFS? > > To clarify, I would the something as convenient as: > > program | read a b > > minus the subshell. > Note that I actually did the following: > > program | { read a b; hooray } > > when I could, so this "solution" doesn't count. > Bonus points if that's something that would also work in bash. >