From: "Andrew Bird (Sphere Systems)" <ajb@spheresystems.co.uk>
To: TW <zupftom@googlemail.com>
Cc: Mike McCarty <Mike.McCarty@sbcglobal.net>,
FreeDOS <linux-msdos@vger.kernel.org>
Subject: Re: piping escape into dosemu
Date: Thu, 11 Mar 2010 09:19:04 +0000 [thread overview]
Message-ID: <201003110919.04676.ajb@spheresystems.co.uk> (raw)
In-Reply-To: <ca6f72e21003110111n386a7260je3244d24b51245b8@mail.gmail.com>
Hi TW,
You might want to investigate the command 'printf', it's rarely implemented
by the shell and has consistent behaviour (no implicit NL etc) across
different platforms. For that reason many shell script writers shy away from
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 <Mike.McCarty@sbcglobal.net>:
> > In fact...
> >
> > $ echo -ne "\033" | od -x
> > 0000000 001b
> > 0000001
> >
> > So, od got exactly one character, which was an ESC.
>
> O.K., one more pitfall. Obviously, the shells use their own internal
> echo and don't call /bin/echo. sh and dash give me
>
> $ echo -ne "\033" | od -x
> 0000000 6e2d 2065 0a1b
> 0000006
>
> i.e. echo is actually echoing the switch "-ne", followed by a space,
> ESC and newline. In bash, I get
>
> tom@tom-desktop:~$ echo --version
> --version
> tom@tom-desktop:~$ /bin/echo --version
> echo (GNU coreutils) 7.4
> Copyright © 2009 Free Software Foundation, Inc.
> Lizenz GPLv3+: GNU GPL Version 3 oder höher
> <http://gnu.org/licenses/gpl.html> Dies ist freie Software: Sie können sie
> ändern und weitergeben.
> Es gibt keinerlei Garantien, soweit wie es das Gesetz erlaubt.
>
> Geschrieben von Brian Fox und Chet Ramey.
>
> I'll be using /bin/echo now to make sure the same echo is used in bash 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
next prev parent reply other threads:[~2010-03-11 9:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 22:18 piping escape into dosemu Mike McCarty
2010-03-06 2:50 ` TW
2010-03-06 2:56 ` TW
2010-03-08 8:16 ` Mike McCarty
2010-03-08 8:29 ` Mike McCarty
2010-03-08 21:40 ` TW
2010-03-08 23:07 ` Mike McCarty
2010-03-10 20:11 ` TW
2010-03-11 6:26 ` Mike McCarty
2010-03-11 8:11 ` TW
2010-03-11 6:55 ` Mike McCarty
2010-03-11 9:11 ` TW
2010-03-11 9:19 ` Andrew Bird (Sphere Systems) [this message]
2010-03-11 12:50 ` TW
[not found] ` <4B98F8EC.9030206@pobox.com>
[not found] ` <ca6f72e21003111250x31e6ca3dt6732fefb59ef2a90@mail.gmail.com>
[not found] ` <4B995B03.40906@pobox.com>
2010-03-11 22:24 ` TW
-- strict thread matches above, loose matches on Subject: below --
2010-02-25 20:21 TW
2010-03-05 7:21 ` TW
2010-03-05 17:59 ` solarflow99
2010-02-24 21:09 x.zupftom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201003110919.04676.ajb@spheresystems.co.uk \
--to=ajb@spheresystems.co.uk \
--cc=Mike.McCarty@sbcglobal.net \
--cc=linux-msdos@vger.kernel.org \
--cc=zupftom@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox