ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hello guys ..
I really do not know how I do this year ..
if you can help me?
is very important ..
It achieves a bash script that takes two parameters (command line). These two parameters must be two paths of two directories (existing, and different such as not being of the other sub-folder). Path1 and path2 are for simplicity.
The script will recursively visit the two directories and all sub-directories, sub-sub-directories, etc.. Looking for differences between their contents (files or directories). In particular, suppose that we work with both path1 and path2 directory, and scanned the files contained therein. These situations can occur:
* Path1 exists in a file that is not present in path2: in this case, the script displays the path of the file to you (print screen) and asks if he wants the file is copied in path2 or not. Reads the user's response and acts accordingly.
* Path2 exists in a file that is not present in path1: in this case, the script displays the path of the file and asks if the user wants the file is copied in path1 or not. Reads the user's response and acts accordingly.
* Both path1 path2 in a file with the same name but different contents: in this case, the script displays the path of the two files (which of course will start with path1 and path2 but end with an equal) to the user together with the two dates have been changed last time. Then asks if you want the file to be replaced by one in path1 path2, or that the file is replaced by one in path2 path1, or that both are left unchanged. Reads the user's response and acts accordingly.
* Both path1 path2 in a file with the same name and same content, in which case the script does nothing and proceeds with the next file.
This is done for all regular files in path1 and path2. The special file (socket, device, symbolic link ...) are ignored. For folders in path1 and path2 is recursively by:
* Path1 if there is a folder that is not present in path2: in this case, the script displays the path to the folder and asks if you want the folder and all its contents are copied to path2. Reads the user's response and acts accordingly.
* Path1 if there is a folder that is not present in path2: similar at first.
* Both path1 path2 that there are two folders with the same name as the script works recursively on the two folders.
Dude, we aren't here to do your work for you. This appears to be a coursework assignment pasted verbatim. Please don't use these forums as a substitute for learning. If you have *specific* problems then please ask *specific* questions.