Enabling server mode

Walt Pawley yellowdog-general@lists.terrasoftsolutions.com
Tue, 10 Aug 2004 13:08:09 -0700


On 8/10/04 8:58 AM -0400, Patrick Smith wrote on Re: Enabling server mode

>>>>printf '\1\2\3' > powerup-boot
>>>
>>>This is again bash specific.  On my shell (tcsh) this just gives:
>>>
>>>gwiz% printf '\1\2\3' > powerup-boot
>>>printf: \1: invalid escape
>>
>>
>> As far as I can tell, it's not bash specific.
>
>Seems to me tcsh is just broken here.  According to the Open Group
>standard, octal escapes are supposed to be interpreted.

I've found curious little interactions amongst shells, escape sequences,
text processing programs and I/O redirection. I'm sure there's much, much
more to confuse all sorts of issues hidden away "in there". If you really
want consistent behavior across systems, I would suggest writing commands
to work in "sh", which I believe has remained pretty stable in its
processing of such things for a long time and hopefully will continue in
that vein. It's nice to have some bed rock to build on.

Just for fun, I tried this on a number of different systems (Mac OS X, YDL
3.0.1, FreeBSD 3.2) and it gave me the same file content on all systems.

perl -e 'print "\x01\x13\x01";' > powerup-boot

That said, so did - printf '\1\2\3' > powerup-boot

FWIW, I'd guess from the error message that it's not the shell that's
causing the trouble but rather the "printf" command is not working like
both my docs and my versions of "printf" seem to. Perhaps the version of
"printf" being used to get the error is old ... or new ... or ???

-- 
Walter M. Pawley <walt@wump.org>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
         541-672-8975