From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 23:12:42 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905EF10656F7 for ; Mon, 26 Jan 2009 23:12:42 +0000 (UTC) (envelope-from svein.h@lvor.halvorsen.cc) Received: from bene1.itea.ntnu.no (bene1.itea.ntnu.no [IPv6:2001:700:300:3::56]) by mx1.freebsd.org (Postfix) with ESMTP id D3C178FC25 for ; Mon, 26 Jan 2009 23:12:41 +0000 (UTC) (envelope-from svein.h@lvor.halvorsen.cc) Received: from localhost (localhost [127.0.0.1]) by bene1.itea.ntnu.no (Postfix) with ESMTP id 6E10B24040 for ; Tue, 27 Jan 2009 00:12:40 +0100 (CET) Received: from maren.thelosingend.net (maren.math.ntnu.no [129.241.211.48]) by bene1.itea.ntnu.no (Postfix) with SMTP id D7F6D24022 for ; Tue, 27 Jan 2009 00:12:39 +0100 (CET) Received: (qmail 34547 invoked by uid 88); 27 Jan 2009 00:09:59 +0100 Received: from maren.math.ntnu.no (HELO [127.0.0.1]) (129.241.211.48) by maren.thelosingend.net (qpsmtpd/0.31.1) with ESMTP; Tue, 27 Jan 2009 00:09:58 +0100 Message-ID: <497E44D5.4070905@lvor.halvorsen.cc> Date: Tue, 27 Jan 2009 00:18:45 +0100 From: Svein Halvor Halvorsen User-Agent: Thunderbird 2.0.0.18 (X11/20081205) MIME-Version: 1.0 To: Chuck Swiger References: <497E31EE.9010202@lvor.halvorsen.cc> <0B02CEE8-D38A-4D94-B76D-49721BDDACF0@mac.com> <497E41B8.2030203@lvor.halvorsen.cc> <6A32981B-AD8F-4CAA-B1BD-38A06654C69A@mac.com> In-Reply-To: <6A32981B-AD8F-4CAA-B1BD-38A06654C69A@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Debian amavisd-new at bene1.itea.ntnu.no Cc: questions@freebsd.org Subject: Re: printf and utf-8 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, 26 Jan 2009 23:12:43 -0000 Chuck Swiger wrote: > On Jan 26, 2009, at 3:05 PM, Svein Halvor Halvorsen wrote: >> Do you have a suggestion to solve the following problem without using >> printf(1): >> >> I have a text file that I want to print in a "box" on a terminal from >> a shell script. Now I've padded the lines with spaces to a certain >> length using printf %-70s and appended the box drawing character. Is >> there another simple way that will work with utf-8? > > My first thought was about dialog(1), but I'm not sure whether that > deals with UTF8 any better...? No, it doesn't seem to. Also it clears the entire screen to draw the box. I only want a small box, and not clear the screen, and I don't want a OK-button or any other user interaction. Just print the simple box, then whatever follows from the script should print after it. Nevertheless, thanks for your help and your time! sv.