It was subset of a quite huge bash script which I was trying to run in Python. I was able to figure out and it's working fine inside Bash itself. I can run on command line but need to give it to others in such a way, they don't need to go into details.
Thank You