test filenames for regex patterns in bash
- by rk
I'm not sure exactly how the code should be written but I want to test a file/folder for naming patterns, something like:
if [ -d $i ] && [ regex([0-9].,$i) {
do something
}
I want it to check if the file/folder is a directory and that the name of it is a number (i.e. 1 or 101 or 10007)...