14 ms·
> awk doesn't offer that much more than sed Not much; just, oh, stuff like floating-point math and trig functions; integer math, associative arrays, access to
by kazinator 9y ago
> awk doesn't offer that much more than sed
Not much; just, oh, stuff like floating-point math and trig functions; integer math, associative arrays, access to environment variables, named functions with arguments and full recursion; control and looping structures like if, for and while, file I/O and redirection, string literals with C escapes, ...
$ awk '$0=sin($1) + cos($2)'
0 1
0.540302
1 0
1.84147
How about sed?
Just kidding ...
- CalChris 9y agoHoly double angle formula, Batman. Awk has command line trig functions? Riddle me this. Is the Google search bar just an Awk script and they won't tell you? That's just the sneaky kind of trick L+S would try.