3 ms·
> bash obviously is just using OS commands with syntactic sugar No, bash is technically not "more" OS than e.g. Python. It just happens that bash is (often) th
by cl3misch 10mo ago
> bash obviously is just using OS commands with syntactic sugar
No, bash is technically not "more" OS than e.g. Python. It just happens that bash is (often) the default shell in the terminal emulator.
- xg15 10mo agoHave to disagree, "technically" yes, both are interpreted languages, but the ergonomics and mental overhead of doing certain things are wildly different: In python, doing math or complex string or collection operations is usually a simple oneliner, but calling shell commands or other OS processes requires fiddling with the subprocess module, writing ad-hoc streaming loops, etc - don't even start with piping several commands together. Bash is the opposite: As long as your task can be structured as a series of shell commands, it absolutely shines - but as soon as you require custom data manipulation in any form, you'll run into awkward edge cases and arbitrary restrictions - even for things that are absolutely basic in other languages.
- t43562 10mo agoThe subprocess module is horrendous but even if it was great bash is simpler. I just think about trying to create a pipe of processes in python without the danger of blocking.
- nr378 10mo ago> In python, ..., calling shell commands or other OS processes requires fiddling with the subprocess module, writing ad-hoc streaming loops, etc - don't even start with piping several commands together. You inspired me to throw something simpler together - https://pypi.org/project/shell-pilot/ https://pypi.org/project/shell-pilot/
- xg15 10mo agoThat looks really cool!
- skeledrew 10mo agoI love Python and dislike Bash, but just look at the difference between listing a folder in Bash vs Python, for example.
- DrewADesign 10mo agoRight. Figure out if other users are logged in using Python. Get a human-readable remaining space on each partition. It’s not like you can’t do in Python, but it’s a whole lot more work than typing <10 characters directly into shell.