I'm fairly new to linux scripting and apologize if this has been asked (did search quite a bit before posting).
I'm creating a simple script to check if certain letter combinations are occurring inside a backup file. The path to these files are device dependent and there are MANY of them so I have a list of the ones I need to check inside a text file.
What I would like to do, is
cat the file and insert the name of the device inside the path to that devices folder and then check the latest backup file. e.g.
cat devicelist.txt | grep A[BCD] /folder1/folder2/$1/latest
This gives me the error:
/latest: No such file or directory
So what I'm doing wrong?