Name: Anonymous 2013-09-29 17:24
$ cat repeat.py
$cat repeat
Rate my code.
import sys
import os
c = sys.argv[1]
i = int(sys.argv[2])
com = open('com.sh', 'w+')
com.write(c)
com.close()
os.system("chmod +x com.sh")
n = 0
while n <= i:
n = n + 1
os.system("./com.sh")$cat repeat
#!/bin/bash
python repeat.py "$1" "$2"
if [ $? != 0 ] ; then
echo "
Usage: repeat ['command'] [# of times to repeat]
EG. repeat 'ls -a' 5
If the command contains spaces, it must be contained in quotes.
"
fiRate my code.