#!/bin/bash
# set -x #uncomment for debug

# Author: Dean Wilson
# Version: 1.0
# Last Updated: 2004/10/16
# This script takes a date in Apache (1.3) error log format and converts
# it into the default Apache (1.3) access log format. If the -e option
# is used you get an escaped version read for pasting into vim

if [ -z "$1" ];then
  echo "Usage: `basename $0` apache-error-date"
elif [ "$1" == "-e" ];then
  shift
  # show escaped version. can be pasted into vim search :)
  echo "$3\/$2\/$5:$4"
else
  # show unescaped version
  echo "$3/$2/$5:$4"
fi
