#! /bin/bash # Last edited on 2007-01-26 09:16:25 by stolfi # Usage: join-sources-for-editing {SOURCEFILE}.. # Concatenates all named C source files into one big # file, suitable for editing. The output is # in "catsep" format, with some lines modified to # make it compilable with gcc and editable with emacs and # stolfi-timestamp.el . datetime=`date '+%Y-%m-%d %H:%M:%S'` timestamp="/* Last edited on ${datetime} by ${USER} */" echo "${timestamp}" > timestamp.txt catsep timestamp.txt "$@" \ | sed \ -e 's:^[\#]FILE:// #FILE:g' \ -e 's:^\([~][~][~]*\)$:// \1:g' \ -e 's:^ *[\#]include *<\([A-Z]\):// #INCLUDE <\1:g' \ -e '/[~~]/,$s:^\(.* Last edited .*\)$:// #TIMESTAMP \1:g' \