zsh-users
 help / color / mirror / code / Atom feed
* lost my space ...
@ 2006-03-29  9:04 Marc Chantreux
  2006-03-29  9:33 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Chantreux @ 2006-03-29  9:04 UTC (permalink / raw)
  To: zsh-users

Hi all,


i'm having some trouble using read to get a wrapped attrivute value of 
an ldif file :

say this text as stdin :

uid: suzan
description: R&D leader,
  doesn't know unix
  but skilled in C programming


the problem is that "while { read line }" will crunch the space at the 
begin of the line. I tried to find an appropriate flag in the doc. with 
no success, so i finally use " for line ( ${(f)"$(cat)"} )" ...

but ... i would like to know ... is there way to use read ?

regards,
mc


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lost my space ...
  2006-03-29  9:04 lost my space Marc Chantreux
@ 2006-03-29  9:33 ` Peter Stephenson
  2006-03-29  9:47   ` Marc Chantreux
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2006-03-29  9:33 UTC (permalink / raw)
  To: zsh-users

Marc Chantreux wrote:
> say this text as stdin :
> 
> uid: suzan
> description: R&D leader,
>   doesn't know unix
>   but skilled in C programming
> 
> 
> the problem is that "while { read line }" will crunch the space at the 
> begin of the line.

Use
  IFS= read line

If you really want raw input lines, you might want the -r flag to read
as well.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lost my space ...
  2006-03-29  9:33 ` Peter Stephenson
@ 2006-03-29  9:47   ` Marc Chantreux
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Chantreux @ 2006-03-29  9:47 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

Peter Stephenson wrote:

> Use
>   IFS= read line

of course ! space is a separator ! thanks, Peter !

mc


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-29  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-29  9:04 lost my space Marc Chantreux
2006-03-29  9:33 ` Peter Stephenson
2006-03-29  9:47   ` Marc Chantreux

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).