On 2012/12/17 18:26, Andres Perera wrote:
> On Mon, Dec 17, 2012 at 6:13 PM, Stuart Henderson <s...@spacehopper.org> 
> wrote:
> > On 2012-12-17, sven falempin <sven.falem...@gmail.com> wrote:
> >> Hello misc readers,
> >>
> >> First, openBSD threads are awesome for debugging.
> >> The trivial topic,
> >> echo -ne "\x00" | nc XXXX port
> >> send a null byte with a GNU echo.
> >>
> >> Echo in openbsd does not have -e (and does not warn whan i try it ..)
> >>
> >> Noob question:
> >> How to send a null byte over netcat ? am i forced to use perl ?
> >
> > you can use octal with echo(1) or printf(1).
> 
> echo(1) is BSD echo (no backslash sequences)
> 
> ksh echo is XSI + BSD

ah, right.

$ echo -n '\000' | hexdump -C  
00000000  00                                                |.|
00000001
$ env echo -n '\000' | hexdump -C  
00000000  5c 30 30 30                                       |\000|
00000004

in which case printf is probably a better idea.

Reply via email to