I've got a script that takes all files with extension of .123 Some of them start with ABC others start with XYZ. I want to take all the files that have XYZ in the PREFIX and move them to a different directory.
For example, XYZothertext.123 and ABCothertext.123 both come in to a directory /test I want to evaluate if any file contains XYZ in the name and if so, move it to /TEMP instead of /test. AND delete from original folder.
if grep -q XYZ "$*.123"; then
mv *.ABC /TEMP
fi
This is probably terribly incorrect. But I'm learning.