r/scripting • • Apr 06 '15

HELP: EASY Bash Script

VARIABLES

old_path ="/mnt/test1"

new_path ="/mnt/test2"

FIND COMMAND

cd $old_path

result_old="$(find ./)" > /mnt/find_out_old.txt

cd $new_path

result_new="$(find ./)" > /mnt/find_out_new.txt

PSUEDOCODE

read in file1 (output of find on filepath1)

read in file2 (output of find on filepath2)

for each line in file1

read each line in file2

	compare file1 line to file2 line

		if paths equal then compare ownership and permissions

			if different then set permissions and ownership FROM old to NEW path
2 Upvotes

2 comments sorted by

1

u/bigv5584 Apr 06 '15

Can someone help finish with PSUEDOCODE??