I realize I typed a ] vs [, hit the wrong key.
The reason the script failed, had nothing to do with the echo command,
The problem was I didn't have a script header, and bash saw the
esc character, and tried to run it as a binary file.
Once I added "#!/bin/bash" to the top, it flagged it as a script and
bash was all to happy to run it without problems.
George
>-----Original Message-----
>From: Brian K. White [mailto:brian aljex com]
>Sent: Thursday, October 03, 2002 6:41 PM
>To: enigma-list redhat com
>Subject: Re: strange "Cannot execute binary file" error message
>
>
>
>----- Original Message -----
>From: "George Gallen" <ggallen slackinc com>
>To: <enigma-list redhat com>
>Sent: Thursday, October 03, 2002 11:35 AM
>Subject: RE: strange "Cannot execute binary file" error message
>
>
>> very intresting, If I imbed a control character in an echo statement,
>> bash WILL NOT run the echo statement.
>>
>> I had to put the characters in a file, then cat the file instead of
>> echoing the characters.....
>>
>> ahhhhh....That was a strange one
>>
>> George
>
>hardly
>"man bash"
>
>echo -en "\033L2"
>
>echo will also echo an embedded real control character just fine if you
>really wanted to do it that way for some reason. the only
>reason not to do
>it that way is simply because it makes it more likely that you
>or someone
>else will come along later and fail to notice the special
>nature of that
>character while editing a script in vi or something and screw up the
>script. but to prove the point, you could type the following line:
>e c h o space quote ctrl-v esc L 2 quote
>
>also, generally, "^]" is not another way to say "esc", it's "^[".
>"^]" is the "escape" hot key in the stock telnet client on most unixes,
>which is completely un-related, and not to be confused either with the
>ansi/vt/emca "command sequence initiator" or CSI which is "esc
>[" which is
>often rendered in termcap/terminfo files as "^[[" or "\E[" or rarely
>"\033["
>
>
>> -----Original Message-----
>> From: George Gallen [mailto:ggallen slackinc com]
>> Sent: Thursday, October 03, 2002 11:17 AM
>> To: 'enigma-list redhat com'
>> Subject: RE: strange "Cannot execute binary file" error message
>>
>>
>> Doesn an ESC character need to be escaped (ie. \)
>>
>> The first echo, even though it looks like "2" is really
>>
>> "^]L2" (esc L 2)
>>
>> do I need to change that to be:
>>
>> "\^]L2"?
>>
>> This works fine on our Tru64 system, so I didn't think it
>needed to be
>> changed for bash.
>>
>> George
>>
>> -----Original Message-----
>> From: George Gallen [mailto:ggallen slackinc com]
>> Sent: Thursday, October 03, 2002 10:57 AM
>> To: 'enigma-list redhat com'
>> Subject: strange "Cannot execute binary file" error message
>>
>>
>>
>> the "{tof}" within this message is actually a x0c Control V,
>Control L
>> The usage being: echo "testing" | ./driver.PR22
>>
>> (echo -n "2" ; cat - | /usr/mbin/lf2crlf ; echo -n "{tof}") | lp -d
>PR32
>>
>> gives the following error:
>> SH: ./driver.PR22: cannot execute binary file
>>
>> and the file's permissions:
>> -rwxr-xr-x 1 root daemon 73 Dec 12 2000 driver.PR22
>>
>> BUT.....
>>
>> (cat - | /usr/mbin/lf2crlf ; echo -n "{tof}") | lp -d PR32
>> works fine
>>
>> and it's permissions:
>> -rwxr-xr-x 1 root daemon 57 Dec 5 2000 driver.PR32
>>
>>
>> any idea of what is happening? why it won't execute the script?
>>
>> George
>>
>>
>
>
>
>_______________________________________________
>enigma-list mailing list
>enigma-list redhat com
>https://listman.redhat.com/mailman/listinfo/enigma-list
>