All of lore.kernel.org
 help / color / mirror / Atom feed
* piping escape into dosemu
@ 2010-02-25 20:21 TW
  2010-03-05  7:21 ` TW
  0 siblings, 1 reply; 19+ messages in thread
From: TW @ 2010-02-25 20:21 UTC (permalink / raw)
  To: linux-msdos

Hi all,

I'm sorry, the crappy webmail service of my e-mail provider messed up
my last message, so here it is again from a different mail account:

I'm using the -U switch to pipe keyboard input into dosemu. I'm
starting dosemu like

  dosemu -U dospipe

and can then pipe keystrokes like

  echo "keystroke dir\r" > dospipe

Are all keystrokes encoded the same way as described for the -input
switch[1]? I'm trying to pipe the escape key, but

  echo "keystroke \^[" > dospipe

doesn't seem to do anything. Any suggestions? By the way, how can I
pipe a single space character?

Thanks in advance!

Thomas W.

[1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-02-25 20:21 piping escape into dosemu TW
@ 2010-03-05  7:21 ` TW
  2010-03-05 17:59   ` solarflow99
  0 siblings, 1 reply; 19+ messages in thread
From: TW @ 2010-03-05  7:21 UTC (permalink / raw)
  To: linux-msdos

Sorry, can't anybody give me a hint about this?  Is there more
documentation on the commands that can be piped into dosemu
(especially the keystroke command, of course)?

Thanks!
Thomas W.


2010/2/25 TW <zupftom@googlemail.com>:
> Hi all,
>
> I'm sorry, the crappy webmail service of my e-mail provider messed up
> my last message, so here it is again from a different mail account:
>
> I'm using the -U switch to pipe keyboard input into dosemu. I'm
> starting dosemu like
>
>  dosemu -U dospipe
>
> and can then pipe keystrokes like
>
>  echo "keystroke dir\r" > dospipe
>
> Are all keystrokes encoded the same way as described for the -input
> switch[1]? I'm trying to pipe the escape key, but
>
>  echo "keystroke \^[" > dospipe
>
> doesn't seem to do anything. Any suggestions? By the way, how can I
> pipe a single space character?
>
> Thanks in advance!
>
> Thomas W.
>
> [1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748
>
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-05  7:21 ` TW
@ 2010-03-05 17:59   ` solarflow99
  0 siblings, 0 replies; 19+ messages in thread
From: solarflow99 @ 2010-03-05 17:59 UTC (permalink / raw)
  To: TW; +Cc: linux-msdos

hmm, i'm not really sure myself, if no one knows here, maybe you will
have to ask the dosemu-devel list.


On Thu, Mar 4, 2010 at 11:21 PM, TW <zupftom@googlemail.com> wrote:
> Sorry, can't anybody give me a hint about this?  Is there more
> documentation on the commands that can be piped into dosemu
> (especially the keystroke command, of course)?
>
> Thanks!
> Thomas W.
>
>
> 2010/2/25 TW <zupftom@googlemail.com>:
>> Hi all,
>>
>> I'm sorry, the crappy webmail service of my e-mail provider messed up
>> my last message, so here it is again from a different mail account:
>>
>> I'm using the -U switch to pipe keyboard input into dosemu. I'm
>> starting dosemu like
>>
>>  dosemu -U dospipe
>>
>> and can then pipe keystrokes like
>>
>>  echo "keystroke dir\r" > dospipe
>>
>> Are all keystrokes encoded the same way as described for the -input
>> switch[1]? I'm trying to pipe the escape key, but
>>
>>  echo "keystroke \^[" > dospipe
>>
>> doesn't seem to do anything. Any suggestions? By the way, how can I
>> pipe a single space character?
>>
>> Thanks in advance!
>>
>> Thomas W.
>>
>> [1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748
>>
> --
> 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
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
       [not found]                   ` <4B995B03.40906@pobox.com>
@ 2010-03-11 22:24                     ` TW
  0 siblings, 0 replies; 19+ messages in thread
From: TW @ 2010-03-11 22:24 UTC (permalink / raw)
  To: Alain Mouette; +Cc: linux-msdos

Thanks all for your effort to help me!  I accidentally didn't reply to
the list, so here it is again:

2010/3/11 Alain Mouette <alainm@pobox.com>:
>
>
> To make sure that it works allways the same, use explicit external:
>
> $ /bin/echo -ne "\033" | od -x
> 0000000 001b
> 0000001
>

It does.

So back to my original problem:  I want to achieve the same effect
that I can with

  dosemu -input 'thedosapp.exe\r\^['

The actual byte sequence that sh passes to dosemu as argument after -input is

  74 68 65 64 6f 73 61 70 70 2e 65 78 65 5c 72 5c 1b

I can get the exact same byte sequence with

  /bin/echo -n 'thedosapp.exe\r\['

For the keystroke command that's piped I need a newline at the end, so
I omit -n and use

  /bin/echo 'keystroke thedosapp.exe\r\^[' > dospipe

Everything gets through except for the ESC.  I guess this is the end
of the song.


Alain suggested later:

2010/3/11 Alain Mouette <alainm@pobox.com>:
>
> Have you tried using 2 ESCs ? maybe you get one at the other ent... this
> happens so many linux programas...
>
>

Unfortunately still no success.  I suspect the string that's piped is
parsed somewhat differently from the string that's passed on the
command line, and this can only be fixed in the source code.

Thomas Weber

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-11  9:19               ` Andrew Bird (Sphere Systems)
@ 2010-03-11 12:50                 ` TW
  0 siblings, 0 replies; 19+ messages in thread
From: TW @ 2010-03-11 12:50 UTC (permalink / raw)
  To: Andrew Bird (Sphere Systems); +Cc: Mike McCarty, FreeDOS

2010/3/11 Andrew Bird (Sphere Systems) <ajb@spheresystems.co.uk>:
> 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.
>

Thanks for the tip.  I'm learning more about the shell here than about
the actual problem :-).  Unfortunatley, in the end I don't want to use
the shell at all for this specific task!

Thomas W.
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-11  9:11             ` TW
@ 2010-03-11  9:19               ` Andrew Bird (Sphere Systems)
  2010-03-11 12:50                 ` TW
       [not found]               ` <4B98F8EC.9030206@pobox.com>
  1 sibling, 1 reply; 19+ messages in thread
From: Andrew Bird (Sphere Systems) @ 2010-03-11  9:19 UTC (permalink / raw)
  To: TW; +Cc: Mike McCarty, FreeDOS

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-11  6:55           ` Mike McCarty
@ 2010-03-11  9:11             ` TW
  2010-03-11  9:19               ` Andrew Bird (Sphere Systems)
       [not found]               ` <4B98F8EC.9030206@pobox.com>
  0 siblings, 2 replies; 19+ messages in thread
From: TW @ 2010-03-11  9:11 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-11  6:26           ` Mike McCarty
@ 2010-03-11  8:11             ` TW
  0 siblings, 0 replies; 19+ messages in thread
From: TW @ 2010-03-11  8:11 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

2010/3/11 Mike McCarty <Mike.McCarty@sbcglobal.net>:
>> Up to
>> now I didn't really use anything but bash.  At least for me, pressing
>> the escape key (however often) does not display anything, but when
>> trying sh and dash, I see that pressing ESC "visually" resuts in ^[.
>
> $ set | grep SHELL
> SHELL=/bin/bash
> SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
>
> $ /bin/bash --version
> GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
> Copyright (C) 2002 Free Software Foundation, Inc.
>
> Perhaps something in SHELLOPTS is different, and modifies that behavior.
>

I'm now using sh for the tests, which properly shows the ESC, so this
bash/ESC thing is only a side show.  I can see nothing wrong with my
bash, though:

tom@tom-desktop:~$ set | grep SHELL
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
tom@tom-desktop:~$ /bin/bash --version
GNU bash, Version 4.0.33(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder jünger <http://gnu.org/licenses/gpl.html>

Dies ist freie Software.  Sie darf verändert und verteilt werden.
Für dieses Programm besteht keinerlei Garantie.

I'm running it on Ubuntu Karmic, 64 bit.  No matter if I run bash in
gnome-terminal or on a text terminal (e.g. on Alt-Ctrl-F1), nothing is
displayed.  sh and dash do it in both cases.

>
> Please note that "some string" and 'some string' are NOT the same.

Thanks for that hint, I didn't give this any attention yet.  (I guess
there's still a lot to learn about the shell for me!)

>
> I'm not ready to throw in the towel. If we keep plugging at it,
> I think we can get there.
>

Your persistence is impressive :-).

>
> What do you get when you do this:
>
> $ echo -n "^[" | wc
>      0       0       1
>

With sh or dash, I get the exact same output.

Thomas
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-10 20:11         ` TW
  2010-03-11  6:26           ` Mike McCarty
@ 2010-03-11  6:55           ` Mike McCarty
  2010-03-11  9:11             ` TW
  1 sibling, 1 reply; 19+ messages in thread
From: Mike McCarty @ 2010-03-11  6:55 UTC (permalink / raw)
  To: FreeDOS

TW wrote:

[...]

> And yes, now something like
> 
>   dosemu -input 'thedosapp.exe\r\^['
> 
> indeed works, many thanks for pointing me to this!  Unfortunately, for
> some reason this only works with the -input switch, but not when
> piping, like
> 
>   echo "keystroke \^[" > dospipe
> 
> (where ^[ is what results from pressing ESC).  It doesn't work through
> dosctrl or Ruby either.  I wonder why this is supported by the -input
> switch, but not by the keystroke command...

To get back to the use of the echo command...

$ echo -n "\033" | wc
       0       1       4

$ echo -ne "\033" | wc
       0       0       1

This looks like a singe ESC character got sent to the
output, to me.

In fact...

$ echo -ne "\033" | od -x
0000000 001b
0000001

So, od got exactly one character, which was an ESC.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  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
  1 sibling, 1 reply; 19+ messages in thread
From: Mike McCarty @ 2010-03-11  6:26 UTC (permalink / raw)
  To: FreeDOS

TW wrote:
> 2010/3/9 Mike McCarty <Mike.McCarty@sbcglobal.net>:
>> TW wrote:
>>> [...] I start dosemu like
>>>
>>>  dosemu -input 'thedosapp.exe\r\^['
>>>
>>> because in the readme[1] I'm told that "\^[" is the syntax for the
>>> escape key.  At least that's how I interpret the "\^x" section.
>> [...] I suspect
>> that you are typing three characters '\', '^', and '['. That
>> is not the intended action. What is intended is that you type
>> a BACKSLASH ('\'), and an ESC. The shell displays on your
>> screen two characters when you type ESC, but that is a single keystroke.
>>
> 
> O.K., I'm beginning to understand what you're talking about.  Up to
> now I didn't really use anything but bash.  At least for me, pressing
> the escape key (however often) does not display anything, but when
> trying sh and dash, I see that pressing ESC "visually" resuts in ^[.

$ set | grep SHELL
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor

$ /bin/bash --version
GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.

Perhaps something in SHELLOPTS is different, and modifies that behavior.

> And yes, now something like
> 
>   dosemu -input 'thedosapp.exe\r\^['
> 
> indeed works, many thanks for pointing me to this!  Unfortunately, for
> some reason this only works with the -input switch, but not when
> piping, like
> 
>   echo "keystroke \^[" > dospipe

Please note that "some string" and 'some string' are NOT the same.
However, in this case, I don't see what difference it would make.

> (where ^[ is what results from pressing ESC).  It doesn't work through
> dosctrl or Ruby either.  I wonder why this is supported by the -input
> switch, but not by the keystroke command...
> 
> I may try to find out more, but I believe fixing it (i.e. making the
> string representing a piped keystroke sequence is parsed in the same
> manner that a keystroke string passed on the command line is) will be
> beyond my possibilities.

I'm not ready to throw in the towel. If we keep plugging at it,
I think we can get there.

> Thanks for your help!

What do you get when you do this:

$ echo -n "^[" | wc
       0       0       1

Do you get the " 0 0 1" output I do? If so, then we can get there.
Or try

$ echo -n '^[' | wc
       0       0       1

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-08 23:07       ` Mike McCarty
@ 2010-03-10 20:11         ` TW
  2010-03-11  6:26           ` Mike McCarty
  2010-03-11  6:55           ` Mike McCarty
  0 siblings, 2 replies; 19+ messages in thread
From: TW @ 2010-03-10 20:11 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

2010/3/9 Mike McCarty <Mike.McCarty@sbcglobal.net>:
> TW wrote:
>> [...] I start dosemu like
>>
>>  dosemu -input 'thedosapp.exe\r\^['
>>
>> because in the readme[1] I'm told that "\^[" is the syntax for the
>> escape key.  At least that's how I interpret the "\^x" section.
>
> [...] I suspect
> that you are typing three characters '\', '^', and '['. That
> is not the intended action. What is intended is that you type
> a BACKSLASH ('\'), and an ESC. The shell displays on your
> screen two characters when you type ESC, but that is a single keystroke.
>

O.K., I'm beginning to understand what you're talking about.  Up to
now I didn't really use anything but bash.  At least for me, pressing
the escape key (however often) does not display anything, but when
trying sh and dash, I see that pressing ESC "visually" resuts in ^[.
And yes, now something like

  dosemu -input 'thedosapp.exe\r\^['

indeed works, many thanks for pointing me to this!  Unfortunately, for
some reason this only works with the -input switch, but not when
piping, like

  echo "keystroke \^[" > dospipe

(where ^[ is what results from pressing ESC).  It doesn't work through
dosctrl or Ruby either.  I wonder why this is supported by the -input
switch, but not by the keystroke command...

>
>> pretty basic.  All I figured out is that the uhook_keystroke()
>> function in dosemu/src/base/misc/userhook.c must be the function that
>> handles the keystroke command.
>
> Well, let's hope that gets you going!
>

I may try to find out more, but I believe fixing it (i.e. making the
string representing a piped keystroke sequence is parsed in the same
manner that a keystroke string passed on the command line is) will be
beyond my possibilities.

Thanks for your help!

Thomas
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-08 21:40     ` TW
@ 2010-03-08 23:07       ` Mike McCarty
  2010-03-10 20:11         ` TW
  0 siblings, 1 reply; 19+ messages in thread
From: Mike McCarty @ 2010-03-08 23:07 UTC (permalink / raw)
  To: FreeDOS

TW wrote:
> Hi Mike,
> 
> thanks for your patience.  I'm sorry if my wording was confusing -
> English is not my mother tongue.

No problem.

> It appears the following problem is equivalent to mine, but simpler to
> describe because it neither involves pipes nor echo:
> 
> Say I have a DOS program that shows kind of a splash screen which can
> be bypassed by hitting ESC.  (This is just an example.)  I'd like to
> automate this, so I start dosemu like
> 
>   dosemu -input 'thedosapp.exe\r\^['
> 
> because in the readme[1] I'm told that "\^[" is the syntax for the
> escape key.  At least that's how I interpret the "\^x" section.

Ok, we have a use/mention problem, I think. In your example, you
give a string enclosed in 'single quotes'. That string, as you
show it, should have two characters after the '\r'. I suspect
that you are typing three characters '\', '^', and '['. That
is not the intended action. What is intended is that you type
a BACKSLASH ('\'), and an ESC. The shell displays on your
screen two characters when you type ESC, but that is a single keystroke.

You may have to type ESC twice to make it work with your shell. In any
case, you should not be typing the '^' and '[' characters; those
are just how the shell displays the input on the screen.

> Unfortunately, this doesn't work.  So what's the syntax for the escape
> key?  I tried to find hints in the source code, but my C know-how is

The ESC key. You may, as I said, have to type it twice. I had to.

> pretty basic.  All I figured out is that the uhook_keystroke()
> function in dosemu/src/base/misc/userhook.c must be the function that
> handles the keystroke command.

Well, let's hope that gets you going!

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  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
  1 sibling, 1 reply; 19+ messages in thread
From: TW @ 2010-03-08 21:40 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

Hi Mike,

thanks for your patience.  I'm sorry if my wording was confusing -
English is not my mother tongue.

It appears the following problem is equivalent to mine, but simpler to
describe because it neither involves pipes nor echo:

Say I have a DOS program that shows kind of a splash screen which can
be bypassed by hitting ESC.  (This is just an example.)  I'd like to
automate this, so I start dosemu like

  dosemu -input 'thedosapp.exe\r\^['

because in the readme[1] I'm told that "\^[" is the syntax for the
escape key.  At least that's how I interpret the "\^x" section.
Unfortunately, this doesn't work.  So what's the syntax for the escape
key?  I tried to find hints in the source code, but my C know-how is
pretty basic.  All I figured out is that the uhook_keystroke()
function in dosemu/src/base/misc/userhook.c must be the function that
handles the keystroke command.


2010/3/8 Mike McCarty <Mike.McCarty@sbcglobal.net>:
> TW wrote:
>
> Oh, I forgot how to pipe a single space character
>
>        echo -n " " > dospipe
>

I sorted at least this one out, it can be achieved like

  echo "\  \ " > dospipe


Thomas W.

[1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748
[2] http://dosemu.sourceforge.net/docs/README-tech/0.98/README-tech-2.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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-08  8:16   ` Mike McCarty
@ 2010-03-08  8:29     ` Mike McCarty
  2010-03-08 21:40     ` TW
  1 sibling, 0 replies; 19+ messages in thread
From: Mike McCarty @ 2010-03-08  8:29 UTC (permalink / raw)
  To: FreeDOS

Mike McCarty wrote:
> Please consider these results:
> 
> $ echo -n "033" | wc
>       0       1       3
> $ echo -n "\033" | wc
>       0       1       4
> $ echo -ne "\033" | wc
>       0       0       1
> 
> The first example passes three characters as output. They
> are '0', '3', and '3'.
> The second example passes four characters as output. They
> are BACKSLASH, '0', '3', and '0'.

I can't believe that typo! I'm so sorry. The characters are
BACKSLASH, '0', '3', and '3'. So sorry for any confusion.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  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
  1 sibling, 2 replies; 19+ messages in thread
From: Mike McCarty @ 2010-03-08  8:16 UTC (permalink / raw)
  To: FreeDOS

TW wrote:

Oh, I forgot how to pipe a single space character

	echo -n " " > dospipe

> Hi Mike,
> 
>> From: Mike McCarty <Mike.McCarty@sbcglobal.net>
>>
>> $ man echo
>>
>> [...]
>>
>>       -e     enable   interpretation  of  the  backslash-escaped
>> characters
>>              listed below
>>
> 
> sorry if I totally misinterpret your post, but I think I do *not* want
> to enable the escaped characters because the keystroke command
> obviously expects to read the escape sequence, not the ascii value

I can't make sense out of this. You seem to be referring to a numeral
or something, but I can't tell. What do you mean by "the ascii value
that results from it"?

Please consider these results:

$ echo -n "033" | wc
       0       1       3
$ echo -n "\033" | wc
       0       1       4
$ echo -ne "\033" | wc
       0       0       1

The first example passes three characters as output. They
are '0', '3', and '3'.
The second example passes four characters as output. They
are BACKSLASH, '0', '3', and '0'.
The third example passes one character as output, which
is the ESC character.

Isn't that what you want?

> that results from it.  Otherwise you would for example not be able to
> send a carriage return, i.e.

I don't understand your objection. Do you or do you not
want the ESC character to appear in the input?

> 
>   echo "keystroke \r" > dospipe
> 
> results in a carriage return in dosemu while
> 
>   echo -e "keystroke \r" > dospipe
> 
> does not.

The -e enables conversion of the escape sequences of three
digit octal numbers into single characters in the output stream.

> I'm just using echo here because it's easily reproducible by everyone.
>  I'm successfully using Ruby to remote control dosemu, but I can't
> pipe the escape key for the named reasons, neither through echo nor
> Ruby or whatever I may chose.  Maybe there is a syntax that allows me
> to pipe ASCII codes (e.g. 27 or hex 1B or octal 033 for the escape
> key) into Dosemu, but I can't find it anywhere.  The readme says
> something about \^[:

You are using words in a way which is not consistent with a single
interpretation of each word.

>     \^x    <Ctrl>x, where X is one of the usual C,M,L,[ ...
>            (e.g.: \^[ == <Ctrl>[ == ESC )
> 
> but I don't have luck with this.  I tried several escape sequences
> that could possibly be used, like \0x1B, \x1B, \033, \0033, still
> nothing.  What am I missing??

I don't know. It's difficult to interpret your language.

Let's try this. How about you describe, in careful detail, what
you want to happen, then describe in detail what you did, and
then describe in detail what you observed.

I have so far interpreted your request along these lines

	I want an application running in a DOSEMU environment
	to behave as if it received a hand typed ESC character.

	I have tried using a pipe. I have used the echo command
	in this manner

		echo -ne "\033" > dospipe

	and what the program running received was [fill in the blank].

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-06  2:50 ` TW
@ 2010-03-06  2:56   ` TW
  2010-03-08  8:16   ` Mike McCarty
  1 sibling, 0 replies; 19+ messages in thread
From: TW @ 2010-03-06  2:56 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

One P.S.:

2010/3/6 TW <zupftom@googlemail.com>:
> [...] I do *not* want
> to enable the escaped characters because the keystroke command
> obviously expects to read the escape sequence, not the ascii value
> that results from it.  Otherwise you would for example not be able to
> send a carriage return,

That's of course not really correct, as

  echo -e "keystroke \\\r" > dospipe

does the job, but I hope you understand what I'm trying to say.  As I
want to pipe the sequences, not the ASCII values, there is no need to
use the -e switch, is there?
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
  2010-03-05 22:18 Mike McCarty
@ 2010-03-06  2:50 ` TW
  2010-03-06  2:56   ` TW
  2010-03-08  8:16   ` Mike McCarty
  0 siblings, 2 replies; 19+ messages in thread
From: TW @ 2010-03-06  2:50 UTC (permalink / raw)
  To: Mike McCarty; +Cc: FreeDOS

Hi Mike,

> From: Mike McCarty <Mike.McCarty@sbcglobal.net>
>
> $ man echo
>
> [...]
>
>       -e     enable   interpretation  of  the  backslash-escaped
> characters
>              listed below
>

sorry if I totally misinterpret your post, but I think I do *not* want
to enable the escaped characters because the keystroke command
obviously expects to read the escape sequence, not the ascii value
that results from it.  Otherwise you would for example not be able to
send a carriage return, i.e.

  echo "keystroke \r" > dospipe

results in a carriage return in dosemu while

  echo -e "keystroke \r" > dospipe

does not.

I'm just using echo here because it's easily reproducible by everyone.
 I'm successfully using Ruby to remote control dosemu, but I can't
pipe the escape key for the named reasons, neither through echo nor
Ruby or whatever I may chose.  Maybe there is a syntax that allows me
to pipe ASCII codes (e.g. 27 or hex 1B or octal 033 for the escape
key) into Dosemu, but I can't find it anywhere.  The readme says
something about \^[:

    \^x    <Ctrl>x, where X is one of the usual C,M,L,[ ...
           (e.g.: \^[ == <Ctrl>[ == ESC )

but I don't have luck with this.  I tried several escape sequences
that could possibly be used, like \0x1B, \x1B, \033, \0033, still
nothing.  What am I missing??

Thomas W.
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: piping escape into dosemu
@ 2010-03-05 22:18 Mike McCarty
  2010-03-06  2:50 ` TW
  0 siblings, 1 reply; 19+ messages in thread
From: Mike McCarty @ 2010-03-05 22:18 UTC (permalink / raw)
  To: FreeDOS

Meant for the whole group to see the answer I gave.
Sorry

-------- Original Message --------
Subject: Re: piping escape into dosemu
Date: Fri, 05 Mar 2010 12:49:59 -0600
From: Mike McCarty <Mike.McCarty@sbcglobal.net>
To: solarflow99 <solarflow99@gmail.com>
References: 
<ca6f72e21002251221q65619043r29c58bbfd8ece428@mail.gmail.com>	 
<ca6f72e21003042321s2f0ec77fnb1555e238fdf44af@mail.gmail.com> 
<7020fd001003050959y57b19119p131a70952683d71a@mail.gmail.com>

solarflow99 wrote:
> hmm, i'm not really sure myself, if no one knows here, maybe you will
> have to ask the dosemu-devel list.

$ man echo

NAME
        echo - display a line of text


SYNOPSIS
        echo [OPTION]... [STRING]...
[...]

        -e     enable   interpretation  of  the  backslash-escaped
characters
               listed below

[...]

        \NNN   the character whose ASCII code is NNN (octal)

[...]

$ echo "\033" > dospipe

> 
> 
> On Thu, Mar 4, 2010 at 11:21 PM, TW <zupftom@googlemail.com> wrote:
>> Sorry, can't anybody give me a hint about this?  Is there more
>> documentation on the commands that can be piped into dosemu
>> (especially the keystroke command, of course)?
>>
>> Thanks!
>> Thomas W.
>>
>>
>> 2010/2/25 TW <zupftom@googlemail.com>:
>>> Hi all,
>>>
>>> I'm sorry, the crappy webmail service of my e-mail provider messed up
>>> my last message, so here it is again from a different mail account:
>>>
>>> I'm using the -U switch to pipe keyboard input into dosemu. I'm
>>> starting dosemu like
>>>
>>>  dosemu -U dospipe
>>>
>>> and can then pipe keystrokes like
>>>
>>>  echo "keystroke dir\r" > dospipe
>>>
>>> Are all keystrokes encoded the same way as described for the -input
>>> switch[1]? I'm trying to pipe the escape key, but
>>>
>>>  echo "keystroke \^[" > dospipe
>>>
>>> doesn't seem to do anything. Any suggestions? By the way, how can I
>>> pipe a single space character?
>>>
>>> Thanks in advance!
>>>
>>> Thomas W.
>>>
>>> [1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748
>>>
>> --
>> 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
> 


-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!


-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* piping escape into dosemu
@ 2010-02-24 21:09 x.zupftom
  0 siblings, 0 replies; 19+ messages in thread
From: x.zupftom @ 2010-02-24 21:09 UTC (permalink / raw)
  To: linux-msdos

Hi all, I'm using the -U switch to pipe keyboard input into dosemu. I'm starting dosemu like dosemu -U dospipe and can then pipe keystrokes like echo "keystroke dir\r" > dospipe Are all keystrokes encoded the same way as described for the -input switch[1]? I'm trying to pipe the escape key, but echo "keystroke \^[" > dospipe doesn't seem to do anything. Any suggestions? By the way, how can I pipe a single space character? Thanks in advance! Thomas W. [1] http://dosemu.sourceforge.net/docs/README/1.4/x724.html#AEN748
___________________________________________________________
WEB.DE DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
http://produkte.web.de/go/02/
--
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-03-11 22:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-25 20:21 piping escape into dosemu TW
2010-03-05  7:21 ` TW
2010-03-05 17:59   ` solarflow99
  -- strict thread matches above, loose matches on Subject: below --
2010-03-05 22:18 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)
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
2010-02-24 21:09 x.zupftom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.