As discussed here for PHP, we can redirect stdout to text file. I'm looking for similar way to redirect stdin to file too.
Though, my google search and search on our site results with little helpful. We can easily do that in Python as discussed here