#!/bin/bash -e
zero="00"
zeroes="${zero}${zero}${zero}${zero}${zero}${zero}${zero}${zero}"
zeroes="${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}"
zeroes="${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}${zeroes}"

volname="$1"
now=$(/bin/date '+%s')

# date1="$(/bin/date -r ${now} '+%Y-%m-%d %H:%M:%S')"
# printf "%sN\n" "${date1}" > /Volumes/"${volname}"/TIMERSET.TXT
# echo ${date1}

# 2012-01-01,00:00:00Y 
date2="$(/bin/date -r ${now} '+%Y-%m-%d,%H:%M:%S')"
date2="$(/bin/date -r ${now} '+%Y%m%d%H%M%S ')"
(printf "%sN " "${date2}" ; echo "${zero}"|xxd -r -p -) > /Volumes/"${volname}"/TIMEREST.txt
oecho ${date2}

# date3="$(/bin/date -r ${now} '+%Y-%m-%d %H:%M:%S')"
# (printf "%s"  "${date3}" ; echo "${zeroes:$((2*${#date3}))}"|xxd -r -p -) > /Volumes/"${volname}"/TIME.TXT
# echo ${date3}
ViewGit