| 1234567891011121314151617181920212223242526 |
- #!/bin/bash
- # Check if two directories are provided as arguments
- if [ $# -ne 2 ]; then
- echo "Usage: $0 <dir1> <dir2>"
- exit 1
- fi
- # Set directory variables
- DIR1=$1
- DIR2=$2
- # Check if directories exist
- if [ ! -d "$DIR1" ]; then
- echo "Directory $DIR1 does not exist"
- exit 1
- fi
- if [ ! -d "$DIR2" ]; then
- echo "Directory $DIR2 does not exist"
- exit 1
- fi
- # Use diff to compare directory contents
- echo "Comparing directory contents:"
- diff -rq "$DIR1" "$DIR2"
|