I might be misunderstanding your question but there's what I make of it:
You have a bunch of files.
You want to run your script over the files, one by one, moving them into either a success or failure folder depending on the outcome of the script. Right?
If so, I'd do something like this:
Code:
for file in <input file dir>/* ; do if script2.sh $file ${file}.output ; then mv $file <success dir>; else mv $file <failure dir>; fi ; done
If you want the output to move with the input file, add another mv command to each of the sections of the if statement.