Re: [ Attn: Randy ] Ad-hoc Parsing?

From: Phil Carmody (thefatphil_demunged_at_yahoo.co.uk)
Date: 12/29/04


Date: 29 Dec 2004 06:23:57 +0200

Herbert Kleebauer <klee@unibwm.de> writes:

> Phil Carmody wrote:
> > Herbert Kleebauer <klee@unibwm.de> writes:
>
>
> > > > Oh joy - the kook technique of out-of-context quotes. Let's go and
> > > > see what the context is first...
> > >
> > > No out-of-context quotes. This quotes shows, that you were
> > > speaking of shell programing in Unix/Linux compared to shell
> > > programming in DOS/Windows:
> >
> > 1) They were out of context quotes, as the quotes came with no context.
>
> The quotes are context free. The only purpose of this quotes
> was, to proof that you have also spoken about shell programming in
> Unix/Linux and not only about shell programming in DOS/Windows
> (using bash and cmd.exe).

But their content is, as I have said probably a dozen times, undisputed;
i.e., I have not denied talking about the things I have talked about.
You _WERE_ disputing their relevance, saying I "changed the subject",
and so the context was essential in order to see that I have not
"changed the subject".
 

> > However, like the troll or crank that you are, you've _removed_ the
> > context that I put back in. That's _exceptionally_ impolite usenet behaviour.
>
> No need for a context in a context free statement.
 
You _still_ havent worked out that I do not deny talking about any of
OSes
Kernel behaviour
Shells
Executable formats
And therefore quoting me make mention of any of the above is a
complete waste of your time. I'm not denying making comments about
any of those. I deny changing the subject, as every time I was
countering deliberate or ignorant misinformation spread by you.

 
> > > ===================================================================
> > > From: Phil Carmody <thefatphil_demunged@yahoo.co.uk>
> > > Subject: Re: [ Attn: Randy ] Ad-hoc Parsing?
> > > Date: 26 Dec 2004 23:21:14 +0200
>
> > > > > It can execute the .com file as easily as a command.com or cmd.exe batch file can.
>
> > > Now you want to tell us, you have only spoken about bash in
> > > Windows (so it can execute .com files) and not about bash
> > > in Linux and that you didn't compare scripting in Linux with
> > > scripting in Windows.
> >
> > Bull***. Still steaming, too, it appears.
> >
> > Where do I claim that I have _only_ spoken about bash in Windows, and
>
> 10 lines above.

Yup, I was right: you're on drugs and hallucinating quite severely.

> > not about bash in Linux? Cite or retract. AGAIN - and get it right this
> > time (i.e. retract - you're citing ain't worth ***).
>
> The whole sub thread is about the statement, that batch scripting in
> DOS/Windows is at least as flexible as csh/sh/bash scripting in
> Unix/Linux.

I think you're getting confused by the fact that the Bourne shell (sh, which
is now almost universally replaced by the "Bourne again shell" bash) is
called the "unix shell". It may be the unix shell, but that doesn't mean it
only runs _in_ Unix, it means it was originally written _for_ unix. Therefore
if people (T.M., Robert, myself) have been discussing the unix
shell without explicitly mentioning an OS, that means they have been making
statements _strictly_ about just the shell itself. Here's a clue for you
to use in the future which might help - statements about a shell are about the
shell. Easy, eh?

> The reason is, that there is a header free executable
> file format in DOS/Windows which makes it possible to directly
> embed cpu instructions within a DOS/Windows batch script.

WRONG. For ***'s sake, Herbert, evolve. Your logic is just plain crap.

If there was no such file format, it would still be possible for
script files to drop _arbitrary data_ to an external file. That
includes files, .EXE files and ELF binaries, and just good old-fashioned
raw binary data. Therefore you cannot logically say that
the existence of .COM files "makes it possible to" do anything
of the sort.

If your scripting language is incapable of dropping arbitrary data
to files, then it is a _lack_ of flexibility of your scripting
language.

I've told you this X times already for some large value of X.

> Now, you
> claimed, that this also is possible with bash scripts. When you
> had to recognize that this is not possible with bash scripts
> in Unix/Linux

WRONG. For ***'s sake, Herbert, evolve. Your so-called facts are
just plain crap.

It is possible in bash to drop arbitrary files onto the filesystem.
That includes executables of all types.

I've told you this X times already for some large value of X.

> you tried to escape
> by separating bash from Unix/Linux:
> But when I restrict they use of bash to DOS/Windows, then my
> statement "It can execute the .com file as easily as a command.com
> or cmd.exe batch file can" becomes true. But this is completely
> out of the context of the complete sub thread. You could also have
> said: But when I introduce a new, header free executable file format
> in Unix/Linux, then my statement becomes true.
>
> The statement "It (bash) can execute the .com file as easily as
> a command.com or cmd.exe batch file can" without the addition
> "when bash is used in DOS/Windows" is not true. If it were true,
> than bash used with any operating system had to be able to execute
> .com files.
 
Nope - it was a comparison of one scripting language to another
scripting language. I make no reference to the OS it is running
on; you ASSume that bash runs only under unix. I'm not going to
feel guilt that you are ignorant that bash runs under MS windows
too.

I repeatedly made statements about bash. You interpreted them
to only refer to bash on unix. Your mistake. Get over it.
 
> > > "But they (unix scripts) can't be more flexible than
> > > DOS/Windows batch scripts, where you can directly
> > > insert processor instructions into the script. Anything
> > > a computer can do, a DOS/Win batch script also can do."
>
> > Your logic is a bit broken
>
> > bad logic, as you can more easily make an executable dropper in
> > the unix shells (sh/bash/csh/tcsh/zsh/ksh) as you can in batch
> > files
>
> You still didn't get it. Because of the size of executables,
> it isn't practical to embed executables (Linux or Win32 programs)
> within a script (therefore it doesn't matter how easy it is to
> extract the executable from the script).

WRONG. For ***'s sake, Herbert, evolve. Your so-called facts are
just plain crap.

You've _twice_ been referred to muppetlabs. By two different people.
I know you're ignoring all the useful information I'm trying to educate
you with, but it appears you're ignoring _everyone_ who can give you
useful information. Using this technique, Herbert, you will never learn.

Is 45 bytes not a small enough ELF executable for you?

echo -ne '\x7fELF\1\0\0\0\0\0\0\0\0\0_%\2\0\3\0\xb5\xff\xeb\2\xe\0_%\4\0\0\0\xf2\xae@\x8a_\xfb \xc3\xcd\x80 \0\1' >| true

There are even some unused fields in the ELF headers there, so they could
in theory be filled with ASCII-friendly replacements rather than NULs.

[SNIP - a Win/DOS batch .COM example]

> And this is possible because of the .com file format.
 
Rearrange the following 5 letters to make a word - WRNOG.
Oh dear. You're having problems with the old logic today, aren't you?
If it's possible in unix to create ELF binaries using sh, then it (the
ability to drop small executables) _cannot_ be "because of the .com file
format".

Sheesh. You're really beginning to grate now.

> > There is provably more functionality in the unix shells, this
>
> > I can't live without features like independent stdout/stderr
> > redirecting and ${//} in bash, and the powerful single and double
> > quoting rules in all sensible unix shells, so I certainly can say
> > that I need the additional flexibility that bash gives me.
>
> Sorry, but that is "functionality" but not "flexibility". I never
> said, that bash isn't much more powerful than comannd.com/cmd.exe.
>
> In this sub thread "flexibility" was defined by:
>
> "T.M. Sommers" wrote:
>
> > One of the biggest advantages of Unix-like shells
> > is that they allow the user to do things that the creator of the
> > shell never imagined.

That is a statement about shells.
 
> Now let's make a little test how flexible bash is. Let us do
> something which "the creator of the shell never imagined"
> (maybe the creator of the bashl had imagined this, so it is build
> into bash already, then we will have to find another example).

OK, you're still talking about shells. Excellent, you've stayed
on topic for a whole paragraph.
 
> Suppose you have a script which installs a program XYZ and
> you want to ask the user whether he really wants to install
> XYZ or not. Now, because also people with bad eyes should
> be able to read the question, you want to use a big font
> and you also want a YES and a NO button which can be clicked
> with the mouse (as an alternative to pressing the y or n key).

Sorry, my vt52 doesn't have a mouse. Any program that refuses
to install over a serial console or over an ssh session isn't
worth installing.

And for reference, people with poor eyesight and any computing
experience are quite likely to be touch-typists rather than
hunt-and-peckers (because the "hunt" part is so inefficient),
and as such are much less likely to be willing to take their
hands off the keyboard to reach for a mouse than the average
dumb user of pointy-clickey GUIs.

> Here a solution for DOS/Windows which don't even use the
> advanced features of cmd.exe so it can also be executed
> in pure DOS.
>
> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> @echo off
> echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>y_n.com
> echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>y_n.com
> echo ?g{F?pKp?rLRaDNgRw?GOL?K?gEC=F_a~?A_on?hSzAG?x?Wir?k?F@MtJ>>y_n.com
> echo @S?~szCwnItL?SwFgbyR?_ND???MuaFz?G@=?gOL?KR?wAQIyA?DxA?AzA>>y_n.com
> echo AT=EwOLbyR?_xQY_z?C_=?C_LAYp@wOGrL?K?ewAHrLbv?OvA_eCcuvRgb>>y_n.com
> echo AWGHAwev?LvA]pAauCAebEL@sqXsUCLco{_KU?sm{Sx{FOgkt\wK@cL?Bo>>y_n.com
> echo LWOsBw`GrL?K@b?MHVslQpOrguvRF=A?It?spGHMuvQN=Ae@s?@OB=PBNs>>y_n.com
> echo ?s_ujJrdXTM__O?_nP?S??G@?pG@?o0x>>y_n.com
>
> y_n.com Do you want to install XYZ?
> if errorlevel 1 echo Installing XYZ
> if not errorlevel 1 echo Not installing XYZ
> del y_n.com
> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
> Now show us a much easier solution using bash/Linux.

What the _fuck_ has linux got to do with a comparison between shells?
You see, Herbert, it's _you_ who can't keep on-topic. Stick sh or bash
on your Win/DOS box, and the following should work perfectly, or perfectly
wrongly, depending on whether 0 or 1 is yes.

-- 8< --------------------------------------------------------------------
#!/bin/sh
umask 0
rm -f y_n.com
echo -e 'Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=\r'>y_n.com
echo -e '0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6\r'>>y_n.com
echo -e '?g{F?pKp?rLRaDNgRw?GOL?K?gEC=F_a~?A_on?hSzAG?x?Wir?k?F@MtJ\r'>>y_n.com
echo -e '@S?~szCwnItL?SwFgbyR?_ND???MuaFz?G@=?gOL?KR?wAQIyA?DxA?AzA\r'>>y_n.com
echo -e 'AT=EwOLbyR?_xQY_z?C_=?C_LAYp@wOGrL?K?ewAHrLbv?OvA_eCcuvRgb\r'>>y_n.com
echo -e 'AWGHAwev?LvA]pAauCAebEL@sqXsUCLco{_KU?sm{Sx{FOgkt\\wK@cL?Bo\r'>>y_n.com
echo -e 'LWOsBw`GrL?K@b?MHVslQpOrguvRF=A?It?spGHMuvQN=Ae@s?@OB=PBNs\r'>>y_n.com
echo -e ?s_ujJrdXTM__O?_nP?S??G@?pG@?o0x>>y_n.com

if ./y_n.com Do you want to install XYZ\? ;
then
  echo Not installing XYZ;
else
  echo Installing XYZ;
fi
rm -f y_n.com
-- 8< --------------------------------------------------------------------

Not all those single quotes are required, but I prefer the alignment.
Shame about the \w, but you can't have everything.

So, what was the flexibility advantage that batch files have over
bash scripts again?

Having said that, don't bother answering - you've failed to answer
so many times in the past that I don't know if I can be bothered
reading your replies any more. You're ->this<- close to joining
The_Sage and alex the yepper in the killfile. My, my, my, what
exciting discussions you'll be able to have about .COM files and,
semicolons you'll be able to have - and, yup, with complete agreement
the whole time!

Phil

-- 
The gun is good. The penis is evil... Go forth and kill.