From owner-freebsd-questions@FreeBSD.ORG Mon Jun 29 09:22:13 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04D8106564A for ; Mon, 29 Jun 2009 09:22:13 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id 845968FC1E for ; Mon, 29 Jun 2009 09:22:13 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from marge.bs.l (e180044049.adsl.alicedsl.de [85.180.44.49]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKv5w-1MLD400mM5-000Kbr; Mon, 29 Jun 2009 11:22:12 +0200 Received: from bsch by marge.bs.l with local (Exim 4.69) (envelope-from ) id 1MLD3z-000757-PL for freebsd-questions@freebsd.org; Mon, 29 Jun 2009 11:22:11 +0200 Date: Mon, 29 Jun 2009 11:22:11 +0200 From: Bertram Scharpf To: freebsd-questions@freebsd.org Message-ID: <20090629092211.GB26781@marge.bs.l> Mail-Followup-To: freebsd-questions@freebsd.org References: <4A48252C.1090808@gmail.com> <4ad871310906281926i54fdac53u1d4681c8060e4d36@mail.gmail.com> <4A4826A5.6020506@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A4826A5.6020506@gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: Bertram Scharpf X-Provags-ID: V01U2FsdGVkX1+8x1ZHPU+j6w/hFiy9E7Nhu8V4g/zBVddLWlh gbjWDGSYp5irkfyNd+nNsOtebSNeV4gUl9G87yQQyodkjrLP2z DDWE/7HGUZCz+a4ACqA0DnbQvn91bPC Subject: Re: what character is a physical newline X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 09:22:14 -0000 Hi, Am Sonntag, 28. Jun 2009, 22:27:49 -0400 schrieb Aryeh M. Friedman: > Glen Barber wrote: >> On Sun, Jun 28, 2009 at 10:21 PM, Aryeh M. >> Friedman wrote: >> >>> I am writting a parser (tokenizes all characters among other things) and >>> need to know what control char is equivelent to a newline (I do not need >>> windows cross compatibility) >> >> What do you mean exactly? What language(s)? If I understand your >> question correctly, the C / C++ / Java / PHP (and I think Perl) >> 'newline' character is '\n' >> > I meant what ascii character does \n actual correspond to (I assume > but just making sure) $ perl -e 'print ord("\n"), "\n"' 10 $ python -c 'print ord("\n")' 10 $ ruby -e 'puts "\n"[0]' 10 $ cat nl.c #include "stdio.h" int main(int argc, char **argv) { printf( "%d\n", '\n'); return 0; } $ cc -o nl nl.c $ ./nl 10 $ echo | od -d 0000000 10 0000001 Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de