E 299 B

12345678910111213141516
  1. #!/bin/rc
  2. # E file - B file, wait until it changes, exit
  3. rfork e
  4. if (! ~ $#* 1) {
  5. echo usage: $0 file >[1=2]
  6. exit usage
  7. }
  8. if (! test -e $1) {
  9. echo $0: $1: no such file >[1=2]
  10. exit no-file
  11. }
  12. otm = `{mtime $1 | awk '{print $1}'}
  13. B $1
  14. while (~ $otm `{mtime $1 | awk '{print $1}'})
  15. sleep 1
  16. exit ''