Use python os.system
to call a bash command, I find that %%
has no effect.
This is my python code:
outputpath = "./"
command = "for dir in $(ls -d " + outputpath + '*/' + ");do echo ${dir%%/}/*.jpeg;done"
print(command)
os.system(command);
The running result is:
for dir in $(ls -d ./*/);do echo ${dir%%/}/*.jpeg;done
./maps//*.jpeg
./maps//*.jpeg
The "%%/" is no effect!
When I run for dir in $(ls -d ./*/);do echo ${dir%%/}/*.jpeg;done
in the shell, the result is ok.
Why?