orig/vinfo.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
     1 #!/bin/csh -f
     2 # RCSid: $Id: vinfo.csh,v 3.2 2004/11/19 23:00:49 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