Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
wc and leading spaces
- X-seq: zsh-users 16276
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: wc and leading spaces
- Date: Mon, 22 Aug 2011 19:53:38 -0400
- 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=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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 — well, GNU's 'wc' does not seem to add leading spaces, but my
standard 'wc' in Mac OS X does…
Messages sorted by:
Reverse Date,
Date,
Thread,
Author