chiark
/
gitweb
/
~ian
/
moebius2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
before abandon this version of rim twist which is nonsense
[moebius2.git]
/
view-cyclicly
1
#!/bin/bash
2
set -e
3
if [ $# -lt 3 ]; then
4
echo >&2 'usage: view-cyclicly ./view-NN file-NN-a.cfm file-NN-b.cfm...'
5
exit 1
6
fi
7
8
viewer=$1; shift
9
10
alt=".alternately"
11
for f in "$@"; do
12
g="${f//_/__}"
13
g="${g//"/"/_:}"
14
alt="${alt}_,$g"
15
done
16
tmp=".tmp$alt"
17
18
ln -sf -- "$1" "$alt"
19
20
"$viewer" "$alt" &
21
trap "kill $!" 0
22
23
while sleep 1.0; do
24
justhad="$1"; shift; set -- "$@" "$justhad"
25
ln -sf -- "$1" "$tmp"
26
mv -f "$tmp" "$alt"
27
echo "==== $1 ===="
28
done