|There are many things wrong with this script. For a start, you don't use labels and gotos in OS X shell scripts. Use a looping construct instead:|
while read c
For a second, as you can see in this example, you need to prefix variable names with $ when you want to extract their value (but not when assigning to the variable), and so on and so on. It looks to me as if you are trying to apply MS-DOS batch file constructs to an OS X shell script. That's just not going to work.
Have a look at this introduction to shell scripting and practice with a few simple scripts before trying anything more ambitious. Alternatively, you could always use AppleScript.