From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Bird (Sphere Systems)" Subject: Re: piping escape into dosemu Date: Thu, 11 Mar 2010 09:19:04 +0000 Message-ID: <201003110919.04676.ajb@spheresystems.co.uk> References: <4B918324.6000308@sbcglobal.net> <4B9893EC.70401@sbcglobal.net> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-msdos-owner@vger.kernel.org List-ID: Content-Type: Text/Plain; charset="iso-8859-1" To: TW Cc: Mike McCarty , FreeDOS Hi TW, You might want to investigate the command 'printf', it's rarely implem= ented=20 by the shell and has consistent behaviour (no implicit NL etc) across=20 different platforms. For that reason many shell script writers shy away= from=20 echo and use printf instead. See man 1 printf for details. Hope that helps, Andrew On Thursday 11 March 2010, TW wrote: > 2010/3/11 Mike McCarty : > > In fact... > >=20 > > $ echo -ne "\033" | od -x > > 0000000 001b > > 0000001 > >=20 > > So, od got exactly one character, which was an ESC. >=20 > O.K., one more pitfall. Obviously, the shells use their own internal > echo and don't call /bin/echo. sh and dash give me >=20 > $ echo -ne "\033" | od -x > 0000000 6e2d 2065 0a1b > 0000006 >=20 > i.e. echo is actually echoing the switch "-ne", followed by a space, > ESC and newline. In bash, I get >=20 > tom@tom-desktop:~$ echo --version > --version > tom@tom-desktop:~$ /bin/echo --version > echo (GNU coreutils) 7.4 > Copyright =A9 2009 Free Software Foundation, Inc. > Lizenz GPLv3+: GNU GPL Version 3 oder h=F6her > Dies ist freie Software: Sie k=F6n= nen sie > =E4ndern und weitergeben. > Es gibt keinerlei Garantien, soweit wie es das Gesetz erlaubt. >=20 > Geschrieben von Brian Fox und Chet Ramey. >=20 > I'll be using /bin/echo now to make sure the same echo is used in bas= h and > sh. -- > To unsubscribe from this list: send the line "unsubscribe linux-msdos= " in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-msdos" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html