5 ms·
Maybe this already exists, but I imagine if someone wrote at library for interacting with gnu or posix commands from python (or ruby, or...) that built up the c
by BoardsOfCanada 3y ago
Maybe this already exists, but I imagine if someone wrote at library for interacting with gnu or posix commands from python (or ruby, or...) that built up the commands in a structured way and parsed the replies and put them in a dict, that would be very nice to use instead of bash-scripts. Every weird thing that you wanted to do would be a lot easier to do in python than in bash, and none of that looking out for spaces in strings and so on.
- meta-meta 3y agohttps://github.com/babashka/babashka https://github.com/babashka/babashka comes to mind
- throwaway858 3y agoThere is this for Haskell, which automatically converts all shell commands (like "ls") to regular Haskell functions: https://chrisdone.com/posts/shell-conduit/ https://chrisdone.com/posts/shell-conduit/ It uses a Haskell streaming library so you can do stuff like shell pipelines and file redirection (but in a more structured, safer and more powerful way)
- Too 3y agojc is the most comprehensive I’m aware of. https://kellyjonbrazil.github.io/jc/ https://kellyjonbrazil.github.io/jc/ Except a lot of the times you don’t need this. The standard library may have what you need. There is no reason to pipe ls through jc, when you could use os.listdir().