#!/usr/pkg/bin/bash # memoblog - blog from Clie memos (C) jc@jcomeau.com GPL'd # each blog must begin with dddd-dd-dd-ddddZ timestamp rm -rf /tmp/memoblog.$$ mkdir /tmp/memoblog.$$ cd /tmp/memoblog.$$ pilot-xfer -p net: -f MemoDB.pdb par x MemoDB.pdb for file in *.pdr; do blogname=`head -n 1 $file | grep -v ' '` if echo $blogname | egrep -q '^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{4}Z$'; then tail -n +2 $file > $blogname.txt perl -pi -e 's/\000/\012/' $blogname.txt # translate final null to linefeed fi if [ -d "$HOME/www/www/blog" ]; then for file in *.txt; do if [ ! -s "$HOME/www/www/blog/$file" ]; then # ignore error about "*.txt" if no .txt files cp $file $HOME/www/www/blog/ 2>/dev/null fi done fi done