#Bash Script - diff with result and mkdir
<p>I am currently a newbie @ scripting with #Bash i was only used scripting in Network Environments.</p>

<p>But i want now to make my life easier to make some automatism in my work.</p>

<p>I want to use a #Bash Script via Jenkins that is performing a comparing between 2 SVN Repositories.
This Script should only make Folders and copy from a Template Directory-Tree (with folders and some files).</p>

<p>Example (On Windows / with Cygwin)
Repository A: C:\SYNC\AA
Repository B: C:\SYNC\AB</p>

<p>So if a folder exist with Name-TT-2016 and Name-BB-2014 on Repository A: i want that the script will copy the folder with same Name but Directory Tree taken from Template TT or Template BB on Repository B:</p>

<p>Template TT has following folder:
A/TEST/1
B/TEST/2
C/TEST/3</p>

<p>Template BB has following folder:
D/TEST/2
E/TEST/3
F/TEST/4</p>

<p>The script should recognize the name of the Folder Name-(TT)or(BB)-2014 and make the directory.</p>

<p>Currently i do this manually but i want a script.</p>

<pre><code>#!/bin/bash
for i in $(ls "C:\SYNC\AA"); do
diff -rq $i "C:\SYNC\BB" 
done
</code></pre>

<p>Then i get a list with only in dir ...
I want that this goes from folder to folder with if and loops maybe.
Also i don't know who i use the output from $diff to make a if or then and mkdir with selected Template Directory.</p>

<p>Maybe you have some ideas that can push me.</p>

<p>Thanks in advance.</p>