Compress command

compress /var/opt/l2/amer/art2/USFINUM0[1-9]200[6-9]_[1-3].CSV
compress /var/opt/l2/amer/art2/USFINUM[10-12]200[6-9]_[1-3].CSV

compress /var/opt/l2/amer/art2/USFINUM0[1-9]20[10-99]_[1-3].CSV
compress /var/opt/l2/amer/art2/USFINUM[10-12]20[10-99]_[1-3].CSV

Is there a way to shorten this or write it in a script. The file to be compressed will be USFINUM but as you can see the month and the year will change and there can be three files (1-3).

Thanks a lot.

Regards,
Indira

How about using !

compress /var/opt/l2/amer/art2/USFINUM*

Do you want to compress all the USFINUM values under compressed directory ?

Thanks a lot. I tried using the wildcard and that did not work. Unix cannot find the file in that case.

Regards,
Indrani

cannot find the file !! ??!!!

are you able to view the files when displayed with ls /var/opt/l2/amer/art2/USFINUM*

I am sorry, did not explain properly. When I run this command with the wild card * it does not pick up the files to compress - probably there are 2-3 files with that name but with different month, year and extensions. Though the file name starts with USFINUM. So had to make it so long.

Thanks for the help.

Regards,
Indira

what difference it is going to make if they have different month / year / day ?
everything would be selected for compression by the meta character ' * '

name20070809.txt
name20061223.txt
name20070230.txt

all the files should be selected the command name*