3 ms·
I'd much prefer an ecosystem of interlocking small commands with uniform options than using classic UNIX do-everything tools such as awk. These generally have t
by speed_spread 5y ago
I'd much prefer an ecosystem of interlocking small commands with uniform options than using classic UNIX do-everything tools such as awk. These generally have terrible syntax that's impossible to remember. If I'm gonna drop to a sublanguage other than the shell, I'll use something sane like Python.
- javert 5y agoTo me it feels like someone could rethink the unix tools in the way you're talking about, and maybe it could become a successful and widely-adopted project. Because a suite of tools like this could live alongside the old unix stuff. The main challenge to doing this well is having good taste and experience. It may be that if you really tried to do this, you'd face tons of UX challenges, and you'd find that tools like awk really were in the sweet spot already.
- Beltalowda 5y agoawk is a lot better at what it does than Python though, and much easier too. Even something simple as "cmd | awk {print $1}" in awk is something like: import sys, re for line in sys.stdin.read().split('\n'): s = re.split('\s+') if len(s) > 0: print(s[0]) else: print() And I probably got that incorrect as it's probably not the way to read stdin (it's been a while since I programmed Python). I can list many gripes with Unix tools, but "awk bad" isn't on that list. It's a small language that solves a very specific problem, and does that surprisingly well. The syntax is about as simple as it gets – no idea how it's "terrible" or "impossible to remember", and it's certainly not "insane" as you seem to be suggesting.