From owner-freebsd-hackers@FreeBSD.ORG Fri May 5 16:32:17 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91A5E16A400 for ; Fri, 5 May 2006 16:32:17 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id D713543D45 for ; Fri, 5 May 2006 16:32:16 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (hwnsps@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k45GW7fd082625; Fri, 5 May 2006 18:32:12 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k45GW2a5082588; Fri, 5 May 2006 18:32:03 +0200 (CEST) (envelope-from olli) Date: Fri, 5 May 2006 18:32:03 +0200 (CEST) Message-Id: <200605051632.k45GW2a5082588@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, cokane@cokane.org In-Reply-To: <346a80220604202041o7d631f43rbde4c84b5f7b16b4@mail.gmail.com> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 05 May 2006 18:32:13 +0200 (CEST) X-Mailman-Approved-At: Fri, 05 May 2006 16:54:48 +0000 Cc: Subject: Re: [PATCH] Fancy rc startup style RFC - v6 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, cokane@cokane.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2006 16:32:17 -0000 Hi, Sorry for replying to an old message, but nobody has responded to this particular question, so I give it a try ... Coleman Kane wrote: > > One unfortunate thing about /bin/sh: [from the sh(1) manpage] > > Only one of the -e and -n options may be specified. > > This means that we may not be able to use the -n to chain multiple echos on > one line... You can use the backslash sequence '\c' with echo -e, which has the same effect as the -n option. See sh(1). Another possibility is to use dd(1) to strip off the new- line (dd(1) lives in /bin, so it's available during boot). A shell function like this does it: echo-en() { x="$*" echo -e "$x" | dd bs=$((${#x}-1)) count=1 2>/dev/null } Although it's a bit less efficient because dd(1) is an external binary, it's more flexible since it can be used for all kinds of cutting and trimming (note that cut(1) resides in /usr/bin). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "When your hammer is C++, everything begins to look like a thumb." -- Steve Haflich, in comp.lang.c++