Created
February 27, 2019 19:29
-
-
Save gioxx/cf3a155561f523ff326e8c50587b133e to your computer and use it in GitHub Desktop.
Script bash per creare un archivio diff partendo da due cartelle contenenti installazioni di YOURLS (https://github.com/YOURLS/YOURLS), vedi https://go.gioxx.org/yourls-diff
This file contains 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/sh | |
# Credits: | |
# https://askubuntu.com/questions/444082/how-to-check-if-1-and-2-are-null | |
# http://linuxcommand.org/lc3_wss0120.php | |
if [ "$1" != "" ] && [ "$2" != "" ]; then | |
echo; echo "Old version = " $1 | |
echo "New version = " $2; echo; | |
diff -rs $1 $2 | awk '/sono identici/{print $5}' | xargs rm -v | |
zip -r $2_diff.zip $2 | |
else | |
echo "-ERROR-" | |
if [ -z "$1" ]; then echo "Old version folder missing"; fi | |
if [ -z "$2" ]; then echo "New version folder missing"; fi | |
echo "Script usage: crea_diff.sh OLDVERSIONFOLDER NEWVERSIONFOLDER" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment