To start, I am using a bash shell on a G4 powerbook running Leopard. I am attempting to write a shell script that will automate the processing of satellite imagery. All the filenames are of the following construction:
A2008196000500.L2
where A indicates the sensor, the next four digits represent the year, the next three represent the julian day, and the remaining represent the hour, minute, and second of observation. All I am interested in are the three digits that specify the julian day, so my filenames are effectively:
?????ddd*.L2 (note it's not enough to say *ddd*, as the three digits of the julian day can match patterns in the rest of the filename)
The julian days of my files range from 001 to 366. I would like to be able to list all the files with julian days that range between two different values (ex all the files between julian day 3 and 10). How do I do this? It's not enough to type:
I am just getting familiar with unix. Would you mind explaining your awk statement. It appears that you are doing a greater than/less than comparison. Will that work if the days have 3 digits (ex 001, 002)?
if it is possible to have an if statement within an awk statement i believe that would solve the problem. There must be a way similar to what you suggested earlier: