From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15833 invoked by alias); 23 Aug 2011 02:32:02 -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: 16280 Received: (qmail 25285 invoked from network); 23 Aug 2011 02:32:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OQ+05Wz+k1VZL/dZqyJXLT4QWcgkRSFRduUroOrtKPc=; b=B6stkka16TbITcMgmB1Aiv8wdInz9QFEgyiQpleDhzWgMv9AuK6VQhxIjPidpIHaRN T3vxnwli7Z1ZRbyMRz0zgN+jwmqwX6nWEdQEL57XcAVzS0mtxZA6wlpUfbjQgbyBcdsl A6ED0hz5oxl1wiOYR20/tcb/Tj+i88k0wuHA4= MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 22 Aug 2011 22:31:55 -0400 Message-ID: Subject: Re: wc and leading spaces From: Aaron Davies To: Zsh Users Content-Type: text/plain; charset=ISO-8859-1 On Mon, Aug 22, 2011 at 7:53 PM, TJ Luoma wrote: > Zsh question: Is there a way to get rid of the spaces without using > either "| awk '{print $1}'" or "| sed 's#^ *##g'"? one cheap way is to let zsh trim them off through word splitting rules pro% wc foo 175 1898 15898 foo pro% echo $(wc foo) 175 1898 15898 foo there's presumably something you can do with zsh pattern matching (14.3 Parameter Expansion in the info manual).... -- Aaron Davies aaron.davies@gmail.com