You've already forked devops-exercises
Added a shorter solution for the directory diff exercise (#344)
Signed-off-by: Fabio Kruger <10956489+krufab@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
1. You are given two directories as arguments and the output should be any difference between the two directories
|
||||
|
||||
### Solution
|
||||
### Solution 1
|
||||
|
||||
Suppose the name of the bash script is ```dirdiff.sh```
|
||||
|
||||
@@ -26,5 +26,12 @@ then
|
||||
fi
|
||||
|
||||
diff -q $1 $2
|
||||
```
|
||||
|
||||
```
|
||||
### Solution 2
|
||||
|
||||
With gnu find, you can use diff to compare directories recursively.
|
||||
|
||||
```shell
|
||||
diff --recursive directory1 directory2
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user