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

Unbelievable how long and convoluted the other answer is, and that it is presented as proof that the AI provided a good solution.




I asked for a "script". Asking for a one-liner does just that, with no input validation, comments, etc...

Fundamentally, bash is just... verbose.

I.e.: Here's the same task implemented in two scripting languages:

PowerShell is 5 lines of code: https://learn.microsoft.com/en-us/azure/virtual-machines/ena...

Bash is several pages: https://learn.microsoft.com/en-us/azure/virtual-machines/ena...


That's more of a reflection of the environment than the scripting language. On a mostly bare linux (debian netinstall or alpine), you are left with loads of text to parse. But as soon as that script becomes unwieldy, then the next option is write an actual program. Windows can afford to do that, because there's only few version out there. But there are lots of different Linux installations. And even the kernel is not guaranteed to be vanilla. So you're either write a script like this, or you go find programs that can help you out.



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

Search: