DEV Community

Discussion on: Python for Bash

Collapse
_andy_lu_ profile image
Andy Lu Author

Thanks, glad you enjoyed it!

I concede to the point that doing all of this with Python is probably more work. I don't think bash is that bad either. The main point of this article was that I'm too lazy to type out essentially 4 commands every time I want to post something to my blog; on top of that, there's some small details regarding file names that need to be observed. Rather than going to learn about doing it in bash and getting the date to be in a certain format, I thought it would be quicker to do it in Python. In the spirit of learning something new, I remembered some subprocess module that is supposed to replace the os.system() function that I am used to. So I thought I would teach myself and write it up for anyone else to benefit from.

I hope that clears it up a bit. I'm not here to make performance claims, just to leave a guide out there for people who have the same problem as me one day. Thanks again for the read!

Collapse
evandam92 profile image
Evan Van Dam

Oh definitely! Having the power of Python mixed with bash or any shell scripting is an awesome combo, especially when you get into anything more than a single if statement really or dealing with fun stuff like date formatting.