Name: Anonymous 2013-09-20 16:28
#!/bin/bash
a="$1"
i=0
while [ $i < $2 ] ; do
i=$(( i + 1 ))
cp "$a" "${a%.jpg}"$i.jpg
doneRewrite this in any language please. (Hint for those that don't know bash, $1, $2, $3 and so are arguments given from the command line, basically argv.)
I have all of it written in python except I can't get the damn shutil to accept the value of i as part of the filename, keeps complaining that it needs a string/buffer, and open(filename, 'wb').write(foo) doesn't work.