[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] About printf "%d\n" with no arguments.
From: |
Peng Yu |
Subject: |
[Help-bash] About printf "%d\n" with no arguments. |
Date: |
Tue, 16 Jul 2013 21:04:33 -0500 |
Hi,
The following command will print "0". But I think the appropriate
output should be nothing. As mentioned in the man page "Write the
formatted arguments to the standard output under the control of the
format", since there are no arguments, nothing should be printed. Is
there a way to configure printf to do what I just described? Thanks.
~$ printf "%d\n"
0
--
Regards,
Peng
P.S. man page also says "If the format requires more arguments than
are supplied, the extra format specifications behave as if a zero
value or null str had been supplied. The return value is zero on
success, non-zero on failure." But I don't think this default is
appropriate in all cases.
- [Help-bash] About printf "%d\n" with no arguments.,
Peng Yu <=