Tente isto:
#!/bin/bash
LongDateTime=$1;
if ["$LongDateTime" = ""]
then
LongDateTime=20140730000255;
fi
Year=${LongDateTime:0:4}
Month=${LongDateTime:4:2}
Day=${LongDateTime:6:2}
echo $LongDateTime
echo $Year
echo $Month
echo $Day
YMD="$Year-$Month-$Day"
echo $YMD
Espero que isso ajude.