From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3190 invoked by alias); 22 Aug 2011 23:54:34 -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: 16276 Received: (qmail 25972 invoked from network); 22 Aug 2011 23:54:23 -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.216.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=f38UMjZBAfZQqHwsLaXBAamRW8Wd40Zmhno621vY0bk=; b=KMcFcn6yMH2F4jtq3V8/G+Ks85goC1MhFRGbyVEMcd8ikjQZPMmOA3g4/8DntLE0e3 VvceA6lN46+kFNt/I2s692b5FxaH966Rp/NHX6YEDMUWTkgdL4EfUlZLfGAZ6TNOuqxn mMMhJ9pD6WdKc3AM4BGqoQh1Jx9SsfVyZzr4U= MIME-Version: 1.0 From: TJ Luoma Date: Mon, 22 Aug 2011 19:53:38 -0400 Message-ID: Subject: wc and leading spaces To: Zsh Users Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Can anyone explain why 'wc' adds leading spaces to its output? ^1 for example: $ ls | wc -l | sed 's# #~#g' ~~~~1299 or in another dir: $ ls | wc -l | sed 's# #~#g' ~~~~~~47 I don't understand why: a) anyone would want leading spaces b) why they add enough spaces so that the numbers are "right" justified (that might not be the proper term, but you get the idea) Zsh question: Is there a way to get rid of the spaces without using either "| awk '{print $1}'" or "| sed 's#^ *##g'"? TjL ^1 =97 well, GNU's 'wc' does not seem to add leading spaces, but my standard 'wc' in Mac OS X does=85