[chk_deployed_ids] Now outputs to database with tab delimiters rather that space

This commit is contained in:
ayakael 2018-03-29 11:20:25 -04:00
parent bceb0679dc
commit c1d3609089
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -22,7 +22,7 @@ chk_deployed_ids() {
if [[ -z "$(awk -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){print $0}}' ${DB_FILE})" ]]; then
_msg ECHO "Fixing accounting for ${flac}"
echo "true ${IMAGEID} ${TRACKID} ${flac}" >> ${DB_FILE}
echo -e "true\t${IMAGEID}\t${TRACKID}\t${flac}" >> ${DB_FILE}
elif [[ "$(awk -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){print $4}}' ${DB_FILE})" != "${flac}" ]]; then
_msg ECHO "Fixing path for ${flac}"
awk -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){$4=path}{print $0}}' ${DB_FILE} > ${DB_FILE}.tmp; mv ${DB_FILE}.tmp ${DB_FILE}