My python program requires a system call with the following command.
"cat "+transDir+transFile+" | grep \""+fileName+" \" | cut -d\" \" -f2- | sed \"s/ (/=/g\" | cut -d\"=\" -f1 | sed \"s/) /=/g\" | cut -d\"=\" -f2- | sed \"s/''"
The string turns out to be something like this
#look at the last two characters, ie. ''
'cat ../results/allTrans.txt | grep "Sentence_L3_1 " | cut -d" " -f2- | sed "s/ (/=/g" | cut -d"=" -f1 | sed "s/) /=/g" | cut -d"=" -f2- | sed "s/'\'\''
As you can see, the last '' has become \'\' in the string. How do I get just ' ' ?

print some_stringto see the actual string.repr()of the string. Do as @Rusty suggested and you'll see that the string is fine.'at the end. BTW, usingcatto feed a file togrepis an anti-pattern, just give the file arg togrepdirectly.formatmethod