1 |
Am 30.05.2012 02:11, schrieb Christoph Junghans: |
2 |
> Hi, |
3 |
> |
4 |
> recently I stumbled across a problem with mawk, which is apprearly |
5 |
> Ubuntu's default awk interpreter. |
6 |
> This brought the idea to my mind of adding a virtual for awk. Beside |
7 |
> the fact that we already have 3 awk interpreters in gx86 (gawk, mawk |
8 |
> and busybox awk), there are other ones like nawk and awka. |
9 |
> |
10 |
> I had some discussions with spanKY on that topic in bug #415689, which |
11 |
> summarizes in the following: |
12 |
> |
13 |
> Advantages: |
14 |
> - mawk is faster - useful for scientific purposes |
15 |
> - busybox awk could replace gawk on minimal systems |
16 |
> - more POSIX conform systems |
17 |
> |
18 |
> Disadvantages: |
19 |
> - some awk code in the tree and portage is probably using GNU |
20 |
> extensions without executing gawk explicitly |
21 |
> - gray zone of Posix 1003.2 (e.g. substr() function and an index of 0) |
22 |
> |
23 |
[...] |
24 |
> |
25 |
> I have tested mawk as default interpreter for a while on my x86 boxes |
26 |
> and didn't observed any problems so far. |
27 |
> |
28 |
> Cheers, |
29 |
> |
30 |
> Christoph |
31 |
> |
32 |
|
33 |
An easy easy way to crash mawk is opening many different files. |
34 |
|
35 |
mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \ |
36 |
gawk '{ print $2 > "/tmp/foo/" $1 }' |
37 |
|
38 |
--> Fills /tmp/foo with small files |
39 |
|
40 |
mkdir -p mkdir /tmp/foo; find "$HOME" -type f -printf '%f %s\n' | \ |
41 |
mawk '{ print $2 > "/tmp/foo/" $1 }' |
42 |
|
43 |
--> Crashes with error 'mawk: cannot open "/tmp/foo/7B090d01" for output |
44 |
(Too many open files)' |
45 |
|
46 |
Probably not the cleverest approach to this but just a reminder that |
47 |
there are still subtle differences. |
48 |
|
49 |
That being said, +1 for giving the choice. |
50 |
|
51 |
Regards, |
52 |
Florian Philipp |