Skip to content

Instantly share code, notes, and snippets.

@gioxx gioxx/crea_diff.sh
Created Feb 27, 2019

Embed
What would you like to do?
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
#!/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
You can’t perform that action at this time.