Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: lost my space ...



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@xxxxxxx>                  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



Messages sorted by: Reverse Date, Date, Thread, Author