Created
October 16, 2022 11:33
-
-
Save justdoit0823/1a5ab62cecbf37634ad2f2a35ba5794a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RES=$(find ~/Documents/collections|awk -F'@@@' '{a=a"@@@"$1;} END {print a;}') | |
echo $RES | |
IFS='@@@' read -ra DATA <<< "$RES" | |
for f in "${DATA[@]}" | |
do | |
filename="${f#/Users/justdoit/Documents/collections/}" | |
# echo "$filename" | |
# echo "$f" | |
if [[ -e ~/Downloads/"$filename" ]]; then | |
continue | |
else | |
echo "$filename" | |
fi | |
done | |
function diff(){ | |
SRCDIR="$1" | |
DSTDIR="$2" | |
RES=$(find $SRCDIR|awk -F'@@@' '{a=a"@@@"$1;} END {print a;}') | |
echo $RES | |
IFS='@@@' read -ra DATA <<< "$RES" | |
for f in "${DATA[@]}" | |
do | |
filename="${f#$SRCDIR}" | |
if [[ -e "$DSTDIR$filename" ]]; then | |
continue | |
else | |
echo "$filename" | |
fi | |
done | |
} | |
function main(){ | |
SRC=$1 | |
DST=$2 | |
diff $SRC $DST | |
} | |
main $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment