diff options
author | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2014-09-19 15:56:26 +0200 |
---|---|---|
committer | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2014-09-19 15:56:26 +0200 |
commit | 872cb8adcfe7b80acb937ac163af39fbcbdb7860 (patch) | |
tree | a024607a8f6a9e987de019390eed883633896d44 | |
parent | 50832bf30abb1230d5956af1c1bf488f3b9a5eb2 (diff) |
+ ifcreate
-rw-r--r-- | ifcreate/a.do | 4 | ||||
-rw-r--r-- | ifcreate/all.do | 29 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ifcreate/a.do b/ifcreate/a.do new file mode 100644 index 0000000..51812a1 --- /dev/null +++ b/ifcreate/a.do @@ -0,0 +1,4 @@ +#!/bin/sh +redo-ifcreate b +sleep 1 +date +%s diff --git a/ifcreate/all.do b/ifcreate/all.do new file mode 100644 index 0000000..06a8561 --- /dev/null +++ b/ifcreate/all.do @@ -0,0 +1,29 @@ +#!/bin/sh +test -e b && rm b + +redo-ifchange a +read a1 <a + +date +%s >b +read b <b + +redo-ifchange a +read a2 <a + +if [ $a1 -le $a2 ]; then + echo 'PASS: a1 <= a2' >&2 +else + echo 'FAIL: a1 > a2' >&2 +fi + +if [ $a1 -le $b ]; then + echo 'PASS: a1 <= b' >&2 +else + echo 'FAIL: a1 > b' >&2 +fi + +if [ $a2 -le $b ]; then + echo 'FAIL: a2 <= b' >&2 +else + echo 'PASS: a2 > b' >&2 +fi |