2 # Exercise ls --block-size and related options.
4 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 .
"${srcdir=.}/tests/init.sh"; path_prepend_ .
/src
28 for size
in 1024 4096 262144; do
29 echo foo |
dd conv
=sync bs
=$size >file$size || fail
=1
31 touch -d '2001-01-01 00:00' file* || fail
=1
33 size_etc
='s/[^ ]* *[^ ]* *//'
35 ls -og * |
sed "$size_etc" >..
/out || fail
=1
36 POSIXLY_CORRECT
=1 ls -og * |
sed "$size_etc" >>..
/out || fail
=1
37 POSIXLY_CORRECT
=1 ls -k -og * |
sed "$size_etc" >>..
/out || fail
=1
39 for var
in BLOCKSIZE BLOCK_SIZE LS_BLOCK_SIZE
; do
40 for blocksize
in 1 512 1K
1KiB
; do
41 (eval $var=$blocksize && export $var &&
44 ls -og -k --block-size=$blocksize *
45 ) |
sed "$size_etc" >>..
/out || fail
=1
52 1024 Jan 1 2001 file1024
53 262144 Jan 1 2001 file262144
54 4096 Jan 1 2001 file4096
55 1024 Jan 1 2001 file1024
56 262144 Jan 1 2001 file262144
57 4096 Jan 1 2001 file4096
58 1024 Jan 1 2001 file1024
59 262144 Jan 1 2001 file262144
60 4096 Jan 1 2001 file4096
61 1024 Jan 1 2001 file1024
62 262144 Jan 1 2001 file262144
63 4096 Jan 1 2001 file4096
64 1024 Jan 1 2001 file1024
65 262144 Jan 1 2001 file262144
66 4096 Jan 1 2001 file4096
67 1024 Jan 1 2001 file1024
68 262144 Jan 1 2001 file262144
69 4096 Jan 1 2001 file4096
70 1024 Jan 1 2001 file1024
71 262144 Jan 1 2001 file262144
72 4096 Jan 1 2001 file4096
73 1024 Jan 1 2001 file1024
74 262144 Jan 1 2001 file262144
75 4096 Jan 1 2001 file4096
77 512 Jan 1 2001 file262144
79 1024 Jan 1 2001 file1024
80 262144 Jan 1 2001 file262144
81 4096 Jan 1 2001 file4096
82 1024 Jan 1 2001 file1024
83 262144 Jan 1 2001 file262144
84 4096 Jan 1 2001 file4096
86 256 Jan 1 2001 file262144
88 1024 Jan 1 2001 file1024
89 262144 Jan 1 2001 file262144
90 4096 Jan 1 2001 file4096
91 1024 Jan 1 2001 file1024
92 262144 Jan 1 2001 file262144
93 4096 Jan 1 2001 file4096
95 256 Jan 1 2001 file262144
97 1024 Jan 1 2001 file1024
98 262144 Jan 1 2001 file262144
99 4096 Jan 1 2001 file4096
100 1024 Jan 1 2001 file1024
101 262144 Jan 1 2001 file262144
102 4096 Jan 1 2001 file4096
103 1024 Jan 1 2001 file1024
104 262144 Jan 1 2001 file262144
105 4096 Jan 1 2001 file4096
106 2 Jan 1 2001 file1024
107 512 Jan 1 2001 file262144
108 8 Jan 1 2001 file4096
109 2 Jan 1 2001 file1024
110 512 Jan 1 2001 file262144
111 8 Jan 1 2001 file4096
112 2 Jan 1 2001 file1024
113 512 Jan 1 2001 file262144
114 8 Jan 1 2001 file4096
115 1 Jan 1 2001 file1024
116 256 Jan 1 2001 file262144
117 4 Jan 1 2001 file4096
118 1 Jan 1 2001 file1024
119 256 Jan 1 2001 file262144
120 4 Jan 1 2001 file4096
121 1 Jan 1 2001 file1024
122 256 Jan 1 2001 file262144
123 4 Jan 1 2001 file4096
124 1 Jan 1 2001 file1024
125 256 Jan 1 2001 file262144
126 4 Jan 1 2001 file4096
127 1 Jan 1 2001 file1024
128 256 Jan 1 2001 file262144
129 4 Jan 1 2001 file4096
130 1 Jan 1 2001 file1024
131 256 Jan 1 2001 file262144
132 4 Jan 1 2001 file4096
133 1024 Jan 1 2001 file1024
134 262144 Jan 1 2001 file262144
135 4096 Jan 1 2001 file4096
136 1024 Jan 1 2001 file1024
137 262144 Jan 1 2001 file262144
138 4096 Jan 1 2001 file4096
139 1024 Jan 1 2001 file1024
140 262144 Jan 1 2001 file262144
141 4096 Jan 1 2001 file4096
142 2 Jan 1 2001 file1024
143 512 Jan 1 2001 file262144
144 8 Jan 1 2001 file4096
145 2 Jan 1 2001 file1024
146 512 Jan 1 2001 file262144
147 8 Jan 1 2001 file4096
148 2 Jan 1 2001 file1024
149 512 Jan 1 2001 file262144
150 8 Jan 1 2001 file4096
151 1 Jan 1 2001 file1024
152 256 Jan 1 2001 file262144
153 4 Jan 1 2001 file4096
154 1 Jan 1 2001 file1024
155 256 Jan 1 2001 file262144
156 4 Jan 1 2001 file4096
157 1 Jan 1 2001 file1024
158 256 Jan 1 2001 file262144
159 4 Jan 1 2001 file4096
160 1 Jan 1 2001 file1024
161 256 Jan 1 2001 file262144
162 4 Jan 1 2001 file4096
163 1 Jan 1 2001 file1024
164 256 Jan 1 2001 file262144
165 4 Jan 1 2001 file4096
166 1 Jan 1 2001 file1024
167 256 Jan 1 2001 file262144
168 4 Jan 1 2001 file4096
171 compare exp out || fail
=1