From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike McCarty Subject: Re: piping escape into dosemu Date: Mon, 08 Mar 2010 02:16:14 -0600 Message-ID: <4B94B24E.4070804@sbcglobal.net> References: <4B918324.6000308@sbcglobal.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-msdos-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: FreeDOS TW wrote: Oh, I forgot how to pipe a single space character echo -n " " > dospipe > Hi Mike, > >> From: Mike McCarty >> >> $ 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 x, where X is one of the usual C,M,L,[ ... > (e.g.: \^[ == [ == 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!