You were probably thinking of something like
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/echo/echo.c?rev=1.10&content-type=text/x-cvsweb-markup

But you might have been using something like
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mg/echo.c?rev=1.66&content-type=text/x-cvsweb-markup

(or, ok, as you suggest in your followup you wrote while I was looking
this up, maybe you were using a shell builtin echo implementation)

-- 
Raul


On Wed, Jan 11, 2017 at 10:09 PM, Pavan Maddamsetti
<[email protected]> wrote:
> int
> main(int argc, char **argv)
> {
> while (argc > 1) {
> puts(argv[1]);
> argc--;
> argv++;
> }
>
> return 0;
> }
>
> Here is an example of a program similar to echo, let's call it test.c,
> where I want to input something like:
>
> ./test "hello world\05\05\05\05\05"
>
> Now if I use echo to do the same thing, the octal characters do not print.
>
> But in my program, and in fact if I just copy the source code for OpenBSD
> echo into a new file and compile that, I see all the octal characters
> printed out including backslashes. And if I use strlen() on the input it
> will tell me the length is 26 instead of 16.
>
> What is going on here, and how do I get the same behavior in my program as
> the system echo?
>
> Thanks.

Reply via email to