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.