I'm checking the output from a script. In some cases the script has failed, and a certain file hasn't been produced. I want to check whether this file is present in a directory and if not, print the directory name. The directories look like:
6680_4#22_SMALT
All the numbers before _SMALT
are variable (they are a unique identifier), and the file within the directory will look something like:
6680_4#22.bam
in this case, again, the numbers before .bam
are variable (they will match the prefix of the directory, i.e. the i.d. before _SMALT
). There are similar questions posted, but I'm not that familiar with bash script. Some explanations would be useful, and also, my problem seems complicated by the fact that the file names change in their prefix. Any help would be greatly appreciated.