[Top][All Lists]

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

Re: printf '\x' exit status is 0

From: Bob Proulx
Subject: Re: printf '\x' exit status is 0
Date: Tue, 10 Jul 2007 14:05:49 -0600
User-agent: Mutt/1.5.9i

Poor Yorick wrote:
> (on my debian system, bashbug reports for bash 2.05)

Is that a Sarge system?  Note that Etch is now the Debian Stable
release.  However that won't change the results from the problem that
you are have reported.

> printf status is 0 but /usr/bin/printf is 1.  Is this the expected behavior?

On a Sarge system:

  $ type printf
  printf is a shell builtin

  $ /usr/bin/printf --version
  printf (GNU coreutils) 5.2.1

This indicates that those are different printf implementations.

> 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

That appears to be a bug to me.  Because printf failed it should
return a non-zero exit code.  I just checked the current 3.2 patch 17
and see no change in that behavior.

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

This appears to be the correct behavior.


reply via email to

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