The original script was maintained by a senior. The shell script was too difficult to understand. The boss asked me to write it again in python. The function is as follows, which is to obtain the timestamp field in the svn log
]
I followed the python writing method, spliced the commands together, and called popen to execute.
But an error was reported when running, as shown below:
Then I measured the front part of cmd, which is
The result is:
It can be seen that the result is correct, so the judgment problem occurs in the sed part. Please help me with your seniors.
Can it work if you copy the command directly to the command line? If it works, it means you made a mistake in organizing the string. For example, you missed the double quotes. For example, "%F" and '"%F"' in python are different, and '2' and '\2' are different. Different
When I first started working, I was too stuck to other people’s ideas. I thought about using Python to implement functions as much as possible. Just use python’s replacement function to solve the problem
No need to
sed/grep
...