Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Stop using awk, use a real programming language+shell instead, with structured data instead of bytestream wrangling:

  > ls -l | get user

  ┌────┬──────┐
  │  0 │ cube │
  │  1 │ cube │
  │  2 │ cube │
  │  3 │ cube │
  │  4 │ cube │
  │  5 │ cube │
  │  6 │ cube │
  │  7 │ cube │
  │  8 │ cube │
  │  9 │ cube │
  │ 10 │ cube │
  │ 11 │ cube │
  │ 12 │ cube │
  │ 13 │ cube │
  │ 14 │ cube │
  │ 15 │ cube │
  └────┴──────┘
You don't need to memorize bad tools' quirks. You can just use good tools.

https://nushell.sh - try Nushell now! It's like PowerShell, if it was good.



PowerShell is open source and available on Linux today for those who enjoy an OO terminal.

MIT licensed.

https://learn.microsoft.com/en-us/powershell/scripting/insta...


> try Nushell now!

So, I'm curious. What's the Nushell reimplementation of the 'crash-dump.awk' script at the end of the "Awk in 20 Minutes" article on ferd.ca ? Do note that "I simply won't deal with weirdly-structured data." isn't an option.


Once you get TSV and CSV related tools, nushell and psh are like toys.


https://www.nushell.sh/commands/docs/from_csv.html

For TSV, use the --separator flag.


Current AWK (One True AWK, under OpenBSD in base) got CSV support, you can read the man page for it.


While your recommendation is sound: this is not only a rudely-worded take, but also missing the point of the parent comment.


Also, the nushell code is self-explanatory. Who knows what $3 refers to?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: