Suppose, I would like to replace the white-space of the PDF file name with underscore. I know there are so many more easy ways, but I want to do it using bash code.
Suppose my python file name is pyFile.py & it contains the following codes:
import re
name = PDFname.replace(" ", "_") # replace any white-space by underscore
print name
And the bash script with file name loop.sh:
#!/bin/bash
for PDFname in *.pdf;
do
echo $PDFname;
python pyFile.py
done
How can I do this so that I can use variable Python code which is called through bash script loop?