[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: echo: octal escapes dont work

From: Bob Proulx
Subject: Re: echo: octal escapes dont work
Date: Sun, 1 Dec 2002 11:44:57 -0700
User-agent: Mutt/1.4i

Pigeon <address@hidden> [2002-11-30 19:24:44 +0000]:
> = So I do:
> $ /bin/echo -ne \377 | hexd2
> 00000000: 33 37 37 
> $
> = I should get 00000000: FF according to the above. Why don't I?
> = Other escape sequences give similar results. (eg \100)

I think you are getting confused by the shell.  The shell is reading
the line first and passing arguments to the command.  Try quoting the
argument to protect it from the shell.

  /bin/echo -ne '\377' | od -tx1

> $ /bin/echo --version
> echo (GNU sh-utils) 1.16

Hmm...  That is getting pretty old now.  Consider updating to a newer
version.  Getting to at least sh-utils 2.0.11 would be good.  Note
that sh-utils has been subsumed by coreutils in the newest packaging.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]