From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C3DCCBC0B for ; Sat, 13 Jan 2007 21:57:00 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0DKv00t006142 for ; Sat, 13 Jan 2007 21:57:00 +0100 Received: by ug-out-1314.google.com with SMTP id k3so402326ugf for ; Sat, 13 Jan 2007 12:57:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SVD3HMe9qC5qSE4oUVd8tIRzi9slg45Sntnt1jYRkEJWty1xdLJdOwgUIIf70A+J64d0PHn66+0VDMgf91P/5MMR2L0uuOgvueAoujbl/s1Xq4EhFBBJ/jQfDaZHubasHJEJ2dvJ7jEsVEdiCDnrcgoUwUfWBMNCzVwY+SygVFQ= Received: by 10.78.201.10 with SMTP id y10mr1376292huf.1168721819863; Sat, 13 Jan 2007 12:56:59 -0800 (PST) Received: by 10.78.16.16 with HTTP; Sat, 13 Jan 2007 12:56:59 -0800 (PST) Message-ID: <19eebd060701131256k71e98475o7e79ac5160afcf9c@mail.gmail.com> Date: Sat, 13 Jan 2007 21:56:59 +0100 From: Goulagman To: caml-list@inria.fr Subject: Re: [Caml-list] color on linux terminal In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_49040_31304602.1168721819765" References: X-j-chkmail-Score: MSGID : 45A9479C.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45A9479C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; markus:01 ocaml:01 blabla:01 ocaml:01 blabla:01 markus:01 033:98 033:98 027:98 027:98 wrote:01 wrote:01 caml-list:01 output:02 output:02 ------=_Part_49040_31304602.1168721819765 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 13/01/07, Markus Weihs wrote: > > Hi, > > to get coloured output on a linux terminal, you can do something like > > echo -e "\033[31m This is now red" > > How can I do this with OCaml? The following doesn't work > > print_string "\033[31m blabla" It's because, for Ocaml, the escape sequence \0xx matches the ASCII character xx in decimal, not in octal. print_string "\027[31m blabla" works fine Thanks in advance, > > Markus > > ------=_Part_49040_31304602.1168721819765 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 13/01/07, Markus Weihs <mweihs@gmx.at> wrote:
Hi,

to get coloured output on a linux terminal, you can do something like

    echo -e "\033[31m This is now red"

How can I do this with OCaml? The following doesn't work

    print_string "\033[31m blabla"

It's because, for Ocaml,   the escape sequence \0xx matches the ASCII character xx in decimal, not in octal.

print_string "\027[31m blabla" works fine

Thanks in advance,

Markus


------=_Part_49040_31304602.1168721819765--