https://leehao.me/posts/python-implement-shell-script-functionality/