Revision dd8daa98413988b11c594e5a3bff8f5659d7ecf7 authored by Florent Renaud on 26 June 2014, 09:41:19 UTC, committed by Florent Renaud on 26 June 2014, 09:41:19 UTC
Originally released on 18 March 2013
Based on Nbody6 downloaded on 29 January 2013
1 parent edab1b7
Raw File
cath
#! /bin/csh -f
#
# cat files with ~one-line headers (name at RH end of line):
#
if ($#argv < 1) exit 0
@ count = 0
foreach file ($argv[*])
#
#   Start each new file on a new page.
#
    if ($count > 0) echo 
    @ count++
#
#   Set up label, and determine its length.
#
    set label = '*  '`date`'  File: "'$file'"  *'
    set temp = `echo -n "$label" | wc`
    set length = $temp[3]
#
#   Determine number of blanks to leave, and save them in blank.
#
    @ nb = 77 - $length 
    if ($nb < 0) @ nb = 0
    set blank = ""
    @ i = 1
    while ($i <= $nb)
	@ i++
	set blank = "$blank"' '
    end
#
#   Determine length of bars, and save them in bar.
#
    set bar = ""
    @ i = 1
    while ($i <= $length)
	@ i++
	set bar = "$bar"'*'
    end
#
#   Now print the header.
#
    echo "$blank$bar" ; echo "$blank$label" ; echo "$blank$bar"
    echo " "
#
#   Finally, print the file!
#
    cat $file
end
back to top