script to search inside list of files
Dear all,
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 /home/file1 /home/file2 /home/file3 i wrote that script but it didn't succeeded Code:
#!/bin/bash |
The line
Code:
if [ echo $?=0 ] Code:
if [ $? -eq 0 ] Code:
if grep -q "default.tmp1" $i |
For the record, if you really mean you want to "append" to the file, you want
Code:
cat /home/whatever >> /home/whatever_else |
Dear colucix
thanks for your tip it works but i had a new error after running the script i had this : - ./replace_advance.sh: line 15: /home/adam//home/adam/file4.zone: No such file or directory iam sure of the existence of the file4 for at this path at the main file and also in it's directory so what do you think about this error thanks again . |
thanks Telemachos but i want to append all the file contents to replace the old one so i use the right operator :) but i use user the wrong word "append" thanks for your help
|
sorry i know where exactly my fault the statement should be wrote like that
cat /home/adam/shadow > $i and i want to thank you all for your last response :) |
All times are GMT -5. The time now is 06:51 AM. |