i want to make a script that loop throw list of the files and search inside every file and if it find a specific pattern inside any file from the list passed it will append another file to it, this list will be passed with full path name .
the file which is file.txt contains all the files names, looks like that
i wrote that script but it didn't succeeded
for i in `cat /home/file.txt`
grep "default.tmp1" $i
if [ echo $?=0 ]
cat /home/shadow > /home/$i
any help will be appreciated