ajout de testupdated()

This commit is contained in:
Jephté Clain 2014-02-25 15:24:48 +04:00
parent 08aaabd37e
commit 76300a5e76
2 changed files with 9 additions and 1 deletions

View File

@ -1 +1 @@
24
25

View File

@ -1154,6 +1154,14 @@ function testsame() {
function testdiff() {
! quietdiff "$@"
}
function testupdated() {
# test si $2 n'existe pas ou si $1 est différent de $2
if [ -f "$2" ]; then
testdiff "$1" "$2"
else
return 0
fi
}
function testnewer() {
# test si $2 n'existe pas ou si $1 est plus récent que $2
test ! -e "$2" -o "$1" -nt "$2"