ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/vinfo.csh
Revision: 3.2
Committed: Fri Nov 19 23:00:49 2004 UTC (19 years, 4 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 3.1: +4 -1 lines
Log Message:
Added check to vinfo to insure that header ends with empty line

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: vinfo.csh,v 3.1 2003/02/22 02:07:30 greg Exp $
3 #
4 # Edit information header in Radiance file
5 #
6 set plist=()
7 set ilist=()
8 foreach f ($*)
9 if (! -f $f:q) then
10 echo "${f}: no such file or directory"
11 continue
12 endif
13 if (! -w $f:q) then
14 echo "$f is read-only"
15 sleep 1
16 continue
17 endif
18 set info="$f.info"
19 getinfo < $f:q > $info:q
20 set plist=($plist:q $f:q)
21 set ilist=($ilist:q $info:q)
22 end
23 vi $ilist:q
24 set i=1
25 while ( $i <= $#plist )
26 set f=$plist[$i]:q
27 set info=$ilist[$i]:q
28 if ("`tail -1 $info:q`" != "") then
29 echo "" >> $info:q
30 endif
31 getinfo < $f:q | cmp -s - $info:q
32 if ($status != 0) then
33 getinfo - < $f:q >> $info:q
34 mv $info:q $f:q
35 else
36 rm $info:q
37 endif
38 @ i++
39 end