I have a script that looks in a particular directory for filenames that match a particular naming criteria. When I use that criteria using an ls command, it displays the correct output, but when I use the same exact substitution criteria with a variable, I am told that the same files, found from command line, do not exist.
PRSQR=pktpr4+(2[6,8-9]|3[0,5,9]|4[1,4]|5[4,9]|6[0,3,6-8]|7[0-3,6]|9[1-3,7])*
will look for any files that begin with pktpr4, followed by one of the criteria, and could end with anything.
when I execute:
ls pktpr4+(2[6,8-9] ... 9[1-3,7])* as you see above, it finds all files with this naming structure.
When I use variable substitution, is doesn't seem to work. I think it's related to the + that I have in the search criteria.
I need to script this, using variable substitution, for a script that will move these files to a particular directory in another filesystem.
PRSQR=pktpr4+(2[6,8-9]|3[0,5,9]|4[1,4]|5[4,9]|6[0,3,6-8]|7[0-3,6]|9[1-3,7])*
will look for any files that begin with pktpr4, followed by one of the criteria, and could end with anything.
when I execute:
ls pktpr4+(2[6,8-9] ... 9[1-3,7])* as you see above, it finds all files with this naming structure.
When I use variable substitution, is doesn't seem to work. I think it's related to the + that I have in the search criteria.
I need to script this, using variable substitution, for a script that will move these files to a particular directory in another filesystem.