Essentially, there are a large number of files in the directory ~/data, each with a four-letter code at the beginning (eg. aaaa001 aaaa002 bbbb001 bbbb002 etc). The argument of this script ($1) is one of these four letter codes.
convertFile is a program written in fortran which takes N arguments, the first N-1 being the location of files that will be converted into one file, which will be outputted to the location in the Nth argument.
When I run (for example):
./convertFile aaaa* output
from the terminal, the "aaaa*" is expanded out and convertFile acts on every file in the expanded list (as one would expect). However, when I try to write a script to do this in an automated process, it doesn't expand out the files, instead passing the explicit directory location ~/data/aaaa* (where, for example, $1 = 'aaaa'). I don't know what's wrong, is there something awry with how I'm concatenating the strings?
I'm afraid I don't know what the shell globbing is, but I tried it in the script and in the terminal prior to running the script, and I have the same problem.
Okay, I feel stupid. It turns out that it was expanding, but there was actually a file called "aaaa*" in the directory, which meant that the first record in the expansion was "aaaa*", and this in turn made it look like all convertfile was getting was the unexpanded string. Thanks so much for your help!