I'm very new to shell scripting, and I need a way to do the following:
I have directory (dir_new) with a list of 15 files that I have to compare (using diff) with the same files on another directory (dir_old).
Three of those files are not supposed to be compared, so I need to leave them out of the test. All files have different names, but these 3 files all start with the same initial (NCP).
I need to know how can I leave those three files out of the FOR sentence that I use to diff the rest of the files. This is what I have:
for name in *
diff "$name" "$dir_new$name" >> logfile
I don't know what to use instead of the * on the first line, that will allow me to use all the files except the ones that start with NCP. I tried for name in !NCP*
and one or two variables, but I had no luck so far.
I'd really appreciate some help!
EDIT: sorry I forgot, I'm using ksh