Using Below given python script, I am trying to copy a text file and trying to create 10 copies of the same file as shown below:
logs1.txt
logs2.txt
.
.
logs10.txt
Basically i need to increment only the number present in destination text file name.
I have tried using "for loop" with range command. But I dont know how to increment a number inside a cp command.
#/usr/bin/env python
import subprocess
class RunCmd(object):
def cmd_run(self, cmd):
self.cmd = cmd
subprocess.call(self.cmd, shell=True)
a = RunCmd()
a.cmd_run('cp /sh/awlog/Logs_new_1.txt /sh/logs/logs1.txt')