Shell script copy files to another path
by BringMara from LinuxQuestions.org on (#53X7R)
I have to make a shell script which compares 2 files line by line and finds different lines.If the number of the different lines is greater than 20,then I have to copy the 2 files to another path and then archive and delete the files.Dir1 and dir2 are the 2 files.What I came up with is:
#!/bin/bash
If [ $(diff dir1 dir2 |wc -l)" -gt 20" ] then
I know I need the cp command but I don't know how to write it exactly.I alsoo need tar for archives and rm $file to delete


#!/bin/bash
If [ $(diff dir1 dir2 |wc -l)" -gt 20" ] then
I know I need the cp command but I don't know how to write it exactly.I alsoo need tar for archives and rm $file to delete