Hacker News new | ask | show | jobs
by tosti 41 days ago
You've got to be kidding me with that syntax. Here's the script in Perl:

   $input = <STDIN>;
   chdir "~/Desktop";
   system("yt-dlp -x --audio-format mp3 $input");
And have you seen errors in powershell? Bill Lumbergh would like such a verbose report, not me.
1 comments

You can get a fairly long way with just bash and perl one-liners. I worked in data science in the 2000s, and this was the typical way I would merge .csv files and do other simple data manipulation tasks interactively.

It's not much fun, and the resulting code tends to be fragile. Every line ends up being piped through utilities like cut, join, awk, and jq.

IMO the structured output from pwsh makes those sort of tasks a great deal easier.

I guess it depends on your view of "easier". You may prefer a scripting language that has everything under one roof (even a compiler!), while I very much prefer the pipeline approach (which has many different compilers).
Powershell also supports pipes. Bash pipes are limited to text files. I concede that the *nix infrastructure of utilities is more mature.
There's no text/binary difference. The I/O streams are effectively always in binary mode.