chiark / gitweb /
bugfixes to view-cyclicly
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Sun, 19 Oct 2008 21:56:04 +0000 (22:56 +0100)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Sun, 19 Oct 2008 21:56:04 +0000 (22:56 +0100)
view-cyclicly

index 34e7087f9b920195ce0eaef2eefc80cd13b1c570..01c0c4cda1ec99541483c4ae7e82a069e96fa469 100755 (executable)
@@ -13,11 +13,16 @@ for f in "$@"; do
        g="${g//"/"/_:}"
        alt="${alt}_,$g"
 done
+tmp=".tmp$alt"
 
 ln -sf -- "$1" "$alt"
+
 "$viewer" "$alt" &
+trap "kill $!" 0
 
 while sleep 1.0; do
        justhad="$1"; shift; set -- "$@" "$justhad"
-       ln -sf -- "$1" "$alt"
+       ln -sf -- "$1" "$tmp"
+       mv -f "$tmp" "$alt"
+       echo "==== $1 ===="
 done