It's not "off-topic" but it isn't a good question either, Voters should have selected "Too Broad" as Seth said on the other question https://askubuntu.com/questions/546408/bash-script-operations-on-two-directories#comment748771_546408
The too broad wording:
There are either too many possible answers, or good answers would be
too long for this format. Please add details to narrow the answer set
or to isolate an issue that can be answered in a few paragraphs.
Also any answer would need to code for the person from scratch, we are not a coding service.
Also the wording of his request, leads us to believe that he copy and pasted a homework assignment, and we won't do his homework for him either. http://meta.askubuntu.com/questions/6520/what-do-we-do-with-homework-like-questions So, I'm willing just to leave those questions closed like they are since they are terrible anyway, and unless a mod wants to fix the reason it would be counterproductive to try and reopen a question that should be closed anyway.
And we don't vote to close as duplicates to things that are already closed.