Don't. My rule is if it's more then 3 lines or more complex than simple commmand call,
it'll be written in Python. It will be easier to read for everyone around and avoid all the shell footguns.
Also whenever I need to do some repetitive file operations writing shell scripts in the command line becomes important.