1 |
On Thursday 7 December 2006 12:00, Andres Buehlmann wrote: |
2 |
|
3 |
> Hi |
4 |
> |
5 |
> I found a problem using seq (from coreutils): |
6 |
> With version 6.4, I get: |
7 |
>[cut] |
8 |
> I.e., zero padding (with decimals) doesn't work. |
9 |
> |
10 |
> However, with the older version 5.94, I get as expected: |
11 |
>[cut] |
12 |
> Can anybody confirm this? Am I missing something or is it simply a bug |
13 |
> in the newer version? |
14 |
|
15 |
Seems that -w only pads with leading zeros. From "info coreutils seq": |
16 |
|
17 |
`-w' |
18 |
`--equal-width' |
19 |
Print all numbers with the same width, by padding with leading |
20 |
zeros. FIRST, STEP, and LAST should all use a fixed point decimal |
21 |
representation. (To have other kinds of padding, use `--format'). |
22 |
|
23 |
>From the above description, it seems that there are two ways to get the |
24 |
output you want: either use the command |
25 |
|
26 |
seq -w 0.00 0.25 1.00 |
27 |
|
28 |
or use -f: |
29 |
|
30 |
seq -f "%0.2f" 0 0.25 1 |
31 |
|
32 |
-- |
33 |
gentoo-user@g.o mailing list |