Is the program running repeatedly? How/what exactly are you trying to do?
Depending on the ways you wanted to do this, I could hammer out some examples. But, we need more explanation on what you're doing.
alc6379
Cookie... That's it
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
The shell script could do this
#!/usr/bin/sh
if [ -a output1.txt ];
then
mv output1.txt 1.txt
else
echo "file: was not written"
fi
if [ -a output2.txt ];
then
mv output2.txt 2.txt
else
echo "file: was not written"
fi
.
.
.
.
When your are finished save the script as a .sh then at the command line do chmod +x .sh
You can then run the shell script from the command line
That's a start, but it's a tad inelegant. Instead of doing that, you could use recursion of some sort with a variable to rename the file, and just reuse a loop to name the files. I'd have to study up a bit on that (my shell scripting's kind of fuzzy), but that'd be more scalable. Like, what if he wanted a file named output35.txt-- he'd have to use that statement 35 times!
alc6379
Cookie... That's it
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147