Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#!/bin/bash
# This is the file ".files.sh" of dednat4.
# See: http://angg.twu.net/dednat4.html
#      http://angg.twu.net/dednat4/.files.sh
#      http://angg.twu.net/dednat4/.files.sh.html
# Author: Eduardo Ochs <eduardoochs@gmail.com>
# Version: 2008jul21
# Public domain.

# Originally, this was just a script that produced the list of files
# that would go in the tarball; but then I noticed that with a few
# changes it could also copy or remove the LaTeX files to the test
# directories...

# (find-eevfile "Makefile" "(TZ=GMT date; date) > VERSION")

# (find-dn4ex "")
# (find-blogme3file "anggmake.lua")
# (find-es "dednat" "tex-src-tgz")
# (find-sh "~/dednat4/.files.sh tarballfiles")
# (find-angg ".emacs" "dednat4-setup")

# (find-dn4sh "./.files.sh")
# (find-dn4sh "./.files.sh    tarballfiles")
# (find-dn4sh "./.files.sh -n rmtexinputs")
# (find-dn4sh "./.files.sh -n cpdemos")
# (find-dn4sh "./.files.sh -n cptexinputs")
# (find-dn4sh "./.files.sh -n rmtexinputs")
# (find-sh "rm -Rv /tmp/dt/; mkdir /tmp/dt/")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh -n cpdemos")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh    cpdemos")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh -n cptexinputs")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh    cptexinputs")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh -n rmtexinputs")
# (find-sh "cd /tmp/dt/ && pwd && ~/dednat4/.files.sh    rmtexinputs")

function main () {
  echo Makefile				;# (find-dn4 "Makefile")
  echo Makefile.base			;# (find-dn4 "Makefile.base")
  echo dednat4.lua			;# (find-dn4 "dednat4.lua")
  echo edrxlib.lua			;# (find-dn4 "edrxlib.lua")
  echo experimental.lua			;# (find-dn4 "experimental.lua")
}
function extras () {
  echo TODO				;# (find-dn4 "TODO")
  echo README				;# (find-dn4 "README")
  echo README.ee			;# (find-dn4 "README.ee")
  echo README.interact			;# (find-dn4 "README.interact")
  echo README.phantoms			;# (find-dn4 "README.phantoms")
  echo README.windows			;# (find-dn4 "README.windows")
  echo .files.sh			;# (find-dn4 ".files.sh")
  echo dednat4.el			;# (find-dn4 "dednat4.el")
}

function texedrx () {
  echo examples/edrx08.sty		;# (find-dn4 "examples/edrx08.sty")
  echo examples/edrxdnt.tex		;# (find-dn4 "examples/edrxdnt.tex")
  echo examples/edrxdefs.tex		;# (find-dn4 "examples/edrxdefs.tex")
  echo examples/edrxheadfoot.tex	;# (find-dn4 "examples/edrxheadfoot.tex")
  echo examples/edrxmain41.tex		;# (find-dn4 "examples/edrxmain41.tex")
  echo examples/edrxmain41a.tex		;# (find-dn4 "examples/edrxmain41a.tex")
}
function texdemos () {
  echo examples/eedemo1.tex		;# (find-dn4 "examples/eedemo1.tex")
  echo examples/eedemo2.tex		;# (find-dn4 "examples/eedemo2.tex")
}
function texother () {
  echo examples/bussproofs.sty
  echo examples/prooftree.sty
  echo examples/proof.sty
  echo examples/diagxy.tex
}

function basenames () { for i in $(cat); do basename $i; done; }
function prepends  () { for i in $(cat); do echo $(dirname $0)/$i; done; }
function run () { echo $1; if [ "$DUMMY" == "no" ]; then eval $1; fi; }
function cps  () { for i in $(prepends);  do run "cp -v $i .";  done; }
function cpss () { for i in $(prepends);  do run "cp -sv $i ."; done; }
function rms  () { for i in $(basenames); do run "rm -v $i";    done; }

function tarballfiles () { echo VERSION; extras; main; texedrx; texdemos; }
function cpdemos      () { { texedrx; texdemos; texother; } | cps; }
function rmdemos      () { { texedrx; texdemos; texother; } | rms; }
function cptexinputs  () { texedrx | cpss; texother | cps; }
function rmtexinputs  () { { texedrx; texother; } | rms; }

DUMMY=no
if [ "$1" == "-n" ]; then
  # Inspired by: (find-node "(make)Echoing")
  echo "# dummy mode, not executing"
  DUMMY=yes
  shift
fi
if [ "$1" == "" ]; then
  echo "Usage: $0 [-n] cpdemos|rmdemos|cptexinputs|rmtexinputs|tarballfiles"
  echo "With '-n' just print the 'cp' and 'rm' commands, do not execute them."
  echo "  cptexinputs: copy some LaTeX files to the current directory."
  echo "  rmtexinputs: remove those files."
  echo "  cpdemos: copy some LaTeX files (for demos) to the current dir."
  echo "  rmdemos: remove those files."
  echo "  tarballfiles: list the files that should go in the tarball."
else
  $*
fi