1. Single file - Replaces Oracle with Naikh
awk '{gsub("Oracle","Naikh",$0); print > FILENAME }' *.txt
2. Multiple Files - Replaces Oracle with Naikh
awk '{gsub("Oracle","Naikh",$0); print > FILENAME }' *.txt
3. All the file which contains a pattern
awk '{gsub("Oracle","Naikh",$0); print > FILENAME }' `find . exec grep -l "Oracle" {} \;
Note: Below command will not work
find . exec grep -l "Oracle" {} \; awk '{gsub("Oracle","Naikh",$0); print > FILENAME }'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment