1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 # Problems with padding, field widths, and `+' through bush-4.2
16 printf "x%10.0fx\n" 123
17 printf -v foo "x%10.0fx" 123
20 printf "x%10.0fx\n" 123
21 printf -v foo "x%10.0fx" 123
24 printf "x%10.fx\n" 123
25 printf -v foo "x%10.fx" 123
28 printf "x%10.2fx\n" 123
29 printf -v foo "x%10.2fx" 123
32 printf "x%10.02fx\n" 123
33 printf -v foo "x%10.02fx" 123
36 printf "x%-010.0fx\n" 123
37 printf -v foo "x%-010.0fx" 123
40 printf "x%+010.0ex\n" 123
41 printf -v foo "x%+010.0ex" 123
44 printf "x%+010.0fx\n" 123
45 printf -v foo "x%+010.0fx" 123
48 printf "x%+010.0gx\n" 123
49 printf -v foo "x%+010.0gx" 123
52 printf "x%+010.0dx\n" 123
53 printf -v foo "x%+010.0dx" 123
56 printf "x%+010.0ldx\n" 123
57 printf -v foo "x%+010.0ldx" 123
60 printf "x%+010.0xx\n" 123
61 printf -v foo "x%+010.0xx" 123
64 printf "x%-+10.0fx\n" 123
65 printf -v foo "x%-+10.0fx" 123
68 printf "x%-+10.0dx\n" 123
69 printf -v foo "x%-+10.0dx" 123
73 printf -v foo "%f" -123
76 printf "x%+10.0fx\n" 123
77 printf -v foo "x%+10.0fx" 123
80 printf "x%+10.0dx\n" 123
81 printf -v foo "x%+10.0dx" 123