Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Rewrite this in any language

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
done


Rewrite 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.

Name: Anonymous 2013-09-20 17:48

try

cp "$a" "${a%.jpg}$i.jpg"

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List