pcoughlin
1/15/2017 - 1:25 AM

Builds files used to compare directory structures with diff

Builds files used to compare directory structures with diff

#!/bin/bash

# Create Site-{file}.txt for each dir in PWD.
# Use diff to compare folders.

echo "Creating site compare files"

for file in */; do
        OutFile="/tmp/d513921756/Site-${file%/}.txt";
        echo "-- Dir $file to $OutFile"
        rm $OutFile
        cd $file
        echo "   `pwd`"
        find . -maxdepth 4 -type d >$OutFile
        sed -i "/\.git/d" $OutFile
        sort $OutFile -o $OutFile
        cd ..
done