bug-bash
[Top][All Lists]
Advanced

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

Re: printf '\x' exit status is 0


From: Chet Ramey
Subject: Re: printf '\x' exit status is 0
Date: Tue, 10 Jul 2007 21:35:56 -0400
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)

Poor Yorick wrote:
> (on my debian system, bashbug reports for bash 2.05)
> 
> printf status is 0 but /usr/bin/printf is 1.  Is this the expected behavior?
> 
> address@hidden:~$ bash3
> address@hidden:~$ bash3 --version
> GNU bash, version 3.00.16(1)-release (i386-pc-linux-gnu)
> Copyright (C) 2004 Free Software Foundation, Inc.
> address@hidden:~$ printf '\x'
> bash3: printf: missing hex digit for \x
> address@hidden:~$ echo $?
> 0

Bash treats unrecognized backslash escapes as characters to be printed
and does not consider them an error.  \x without any hex digits doesn't
have any special meaning, though, since it's probably not what's
intended, bash prints a warning.

Chet

> address@hidden:~$ /usr/bin/printf '\x'
> /usr/bin/printf: missing hexadecimal number in escape
> address@hidden:~$ echo $?
> 1
> 


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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