From owner-freebsd-questions Sun Mar 31 12:27:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from web9401.mail.yahoo.com (web9401.mail.yahoo.com [216.136.129.107]) by hub.freebsd.org (Postfix) with SMTP id 5D8F637B417 for ; Sun, 31 Mar 2002 12:27:13 -0800 (PST) Message-ID: <20020331202713.66909.qmail@web9401.mail.yahoo.com> Received: from [65.94.26.37] by web9401.mail.yahoo.com via HTTP; Sun, 31 Mar 2002 12:27:13 PST Date: Sun, 31 Mar 2002 12:27:13 -0800 (PST) From: Eric Boucher Subject: exact length of a line in a file with the read command To: FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi everyone, I have this problem: I want to know the exact length of each line in a file. But it seems that when the file begin or end with a space caracter of a tab caracter, the "read" command in bourne shell delete them and return me only what begin with a letter and end with a letter. So when I try to know the exact length of a file (I tried with both lenght command from "expr" and "nawk"). So if for example, a line is like this (note: mean the real space caracter and the tab caracter) toto the read return me only: toto which is of length = 4 but it is suppose to be of length = 6 The same thing append if the space or the tab caracter are at the end of a line. I also tried to make IFS="", so the there is no field seperator, but it doesn't seems to work too. Can somebody help me? Thanks __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message