Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
Created April 15, 2014 16:09
Show Gist options
  • Save 6LYTH3/10744440 to your computer and use it in GitHub Desktop.
Save 6LYTH3/10744440 to your computer and use it in GitHub Desktop.
Update ET
#!/bin/bash
PATHDATA="/home/administrator/Data/"
RAWDATA=`ls -rtl --time-style=+"%d-%b-%y:%H:%M:%S" $PATHDATA | sed 1d | awk '{print $6, $NF}'`
for rawdata in $RAWDATA;
do
CHECK=`echo ${rawdata} | awk -F"." '{print $2}'`
if [ -z $CHECK ]
then
RAW=$rawdata
else
sed "s/[0-9]*-\(.*:\)[0-9]*:[0-9]*:[0-9]*/${RAW}/g" ${PATHDATA}${rawdata} > t | mv t ${PATHDATA}${rawdata}
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment