This website is currently based on org mode files that are org-publish-blog'd. Now, since i want to have alpha, beta and gamma (live) versions of the website itself, but currently it seems that a lot is based on one file, i needed something else.

So, this is a start:

DIR="$( cd "$( dirname "$0" )" && pwd )"
filename=${DIR}/../alpha.common-lisp.net/alpha.common-lisp.net.org 
output_dir=${DIR}/../beta.common-lisp.net
output_header=${output_dir}/beta.common-lisp.net.org.start 
output_filename=${output_dir}/beta.common-lisp.net.org 
start=$(grep -in  '^\* Common.*$' $filename |cut -f1 -d:)
tmp_file=`mktemp`


cat $output_header > $tmp_file
tail -n +$start $filename >> $tmp_file
sed -n '1h;1!H;${;g;s/\* Alpha.*\* Beta/\* Beta/g;p;}' $tmp_file > $output_filename
rm $tmp_file
blog comments powered by Disqus