]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/printf4.sub
Bash-5.2 patch 26: fix typo when specifying readline's custom color prefix
[thirdparty/bash.git] / tests / printf4.sub
CommitLineData
8868edaf
CR
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.
5#
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.
10#
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/>.
13#
ac50fbac
CR
14# Problems with padding, field widths, and `+' through bash-4.2
15
16printf "x%10.0fx\n" 123
17printf -v foo "x%10.0fx" 123
18echo "$foo"
19
20printf "x%10.0fx\n" 123
21printf -v foo "x%10.0fx" 123
22echo "$foo"
23
24printf "x%10.fx\n" 123
25printf -v foo "x%10.fx" 123
26echo "$foo"
27
28printf "x%10.2fx\n" 123
29printf -v foo "x%10.2fx" 123
30echo "$foo"
31
32printf "x%10.02fx\n" 123
33printf -v foo "x%10.02fx" 123
34echo "$foo"
35
36printf "x%-010.0fx\n" 123
37printf -v foo "x%-010.0fx" 123
38echo "$foo"
39
40printf "x%+010.0ex\n" 123
41printf -v foo "x%+010.0ex" 123
42echo "$foo"
43
44printf "x%+010.0fx\n" 123
45printf -v foo "x%+010.0fx" 123
46echo "$foo"
47
48printf "x%+010.0gx\n" 123
49printf -v foo "x%+010.0gx" 123
50echo "$foo"
51
52printf "x%+010.0dx\n" 123
53printf -v foo "x%+010.0dx" 123
54echo "$foo"
55
56printf "x%+010.0ldx\n" 123
57printf -v foo "x%+010.0ldx" 123
58echo "$foo"
59
60printf "x%+010.0xx\n" 123
61printf -v foo "x%+010.0xx" 123
62echo "$foo"
63
64printf "x%-+10.0fx\n" 123
65printf -v foo "x%-+10.0fx" 123
66echo "$foo"
67
68printf "x%-+10.0dx\n" 123
69printf -v foo "x%-+10.0dx" 123
70echo "$foo"
71
72printf "%f\n" -123
73printf -v foo "%f" -123
74echo "$foo"
75
76printf "x%+10.0fx\n" 123
77printf -v foo "x%+10.0fx" 123
78echo "$foo"
79
80printf "x%+10.0dx\n" 123
81printf -v foo "x%+10.0dx" 123
82echo "$foo"