I'm afraid the logic of what you are trying to do won't work. You cannot assign two values to a variable, when you assign the second, the first is lost. This means that this would never do what you want:
number=1 ## $number is now 1 number=2 ## $number is now 2, and the original value 1 has been replaced.
So, in order to make two copies of a file, you need to use a different approach.
Here are some ideas (note that I put your variable names in lower case: it's bad practice to use CAPS for shell script variable names since by convention, the global environment variables are capitalized, so this can lead to naming collisions and hard to debug issues):
Make one copy inside the case statement, the other afterwards:
case $file in "file1") cp textfile.txt 23.txt number="34";; "file2") number="56";; esac mv textfile.txt $number.txt
use an array instead
case $file in "file1") numbers+=(23 34);; "file2") numbers+=(56);; esac for number in "${numbers[@]}"; do cp textfile.txt "$number".txt done rm textfile.txt
One drawback with this approach is that it does everything by copying instead of moving so it will be slightly slower since the first approach has at least one mv operation. You can't have more than one mv, but at least you can modify this so it makes one mv and so is as fast as the first approach:
case $file in "file1") numbers+=(23 34);; "file2") numbers+=(56);; esac ## Iterate over all except the first element of the array for number in "${numbers[@]:1}"; do cp textfile.txt "$number".txt done ## move the file using the first number in the array mv textfile.txt "${numbers[0]}".txt
textfile.txt, one named12.txtand another named24.txt?