Skip to main content
13 events
when toggle format what by license comment
Jun 7, 2013 at 17:14 history edited Stéphane Chazelas CC BY-SA 3.0
adapted to avoid POSIX character classes which mawk doesn't support and simplified
Jun 7, 2013 at 13:57 comment added Stéphane Chazelas @l0b0, mawk doesn't support POSIX character classes, you can use [ \t] there.
Jun 7, 2013 at 13:55 comment added Stéphane Chazelas @l0b0, it looks the library up and mmaps them, but do not load the code except the init section of the libraries it doesn't use. Use the -s option to minimise the impact. gigabytes was a bit of an exageration.
Jun 7, 2013 at 13:27 comment added l0b0 Ah, thanks @StephaneChazelas. I assumed ex would load with minimal dependencies.
Jun 7, 2013 at 13:27 comment added l0b0 PS: Works with GNU awk 3.1.4, but not with mawk 1.2. No output, and no changes to the file.
Jun 7, 2013 at 13:21 comment added Stéphane Chazelas @l0b0, your ex sounds like vim. If it's the vim with gnome support, it probably pulls gigabytes of library dependencies. There may be some plugin loading from vim files as well.
Jun 7, 2013 at 13:20 vote accept l0b0
Jun 7, 2013 at 13:04 comment added l0b0 Sure, I was just surprised that the startup time of ex (even when reading the file) was much more than the combined startup time of tac, awk and dd plus a subshell.
Jun 7, 2013 at 12:39 comment added Stéphane Chazelas @l0b0, for such a short file, the difference is only going to be due to the loading time of the utilities. Note that ex will need to read the whole file, but not store the whole content in memory (though it will still need to store a fair amount of information in memory). YMMV depending on the ex implementation.
Jun 7, 2013 at 12:29 comment added cuonglm I think ex is not the solution, it must read the whole file before execute command.
Jun 7, 2013 at 12:27 comment added l0b0 Wow. My single ex command is almost three times slower than this, even on a 267 byte file.
Jun 7, 2013 at 12:10 history edited Stéphane Chazelas CC BY-SA 3.0
added 160 characters in body
Jun 7, 2013 at 12:02 history answered Stéphane Chazelas CC BY-SA 3.0