3 ms·
Best shell productivity trick ever: don't use the shell for anything more complicated than launching executables and use a reasonably modern programming languag
by seemslegit 6y ago
Best shell productivity trick ever: don't use the shell for anything more complicated than launching executables and use a reasonably modern programming language to achieve all other tasks.
- wasdfff 6y agoWhat is a reasonably modern language? Everything seems to be at least 20 years old now.
- bhaak 6y agoOP might have made their statements tongue in cheek. But there's the truth in there that even programming languages that are 20 years old had a completely different mindset applied to their design process than the original Unix shell which was much more ad-hoc. 40 years ago IT was a completey different environment than 20 years ago.
- seemslegit 6y agoNot tongue in cheek at all, python might be 20 years old but is continually developed, has come all the way to have a typing system and has a huge ecosystem for all things devops
- serf 6y agono thanks. 'rename .txt _1.txt *' is quite a few lines in a language that's super simple, like Python, and it turns into code golf with even more terse languages. I'll stick to the terminal.
- kortex 6y ago> anything more complicated than launching executables mv is a simple executable. GP is talking about stuff like generating reports or sophisticated orchestration in .sh
- jabl 6y agoI'd love a good answer here. Shell is clunky and annoying as hell, but a "better" language like python is very verbose for typical shell stuff like process management (processes, pipes, signal handling), small text handling tasks like regex matching or string splitting. Perl is maybe the closest here, but it certainly has it's fair share of annoyances, and I more or less dropped perl for python decades ago and don't particularly feel like going back.
- seemslegit 6y agoNot really, with python there's a habbit-acquiring curve but you end up with longer lasting more readable and maintainable assets that can be modularized refactored etc. perl is write-only and has little going for it afaic but ymmv.