-
Notifications
You must be signed in to change notification settings - Fork 0
/
repairlog.sh
executable file
·24 lines (18 loc) · 1.06 KB
/
repairlog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# filename: repairlog.sh
###############################################################################
# #
# ADS-B_heatmaps: Collection of Linux Scripts for ADS-B data visualization #
# Coded by A.D. Wright - GPLv3 License - github.com/AD-Wright/ADS-B_heatmaps #
# #
###############################################################################
### USER CONFIGURATION ###
# installed directory (update after installation)
INSTALL_DIR=~/Documents/Gits/ADS-B_heatmaps
LOG_DIR=$INSTALL_DIR/log # directory needs to exist or script will fail
### END USER CONFIGURATION ###
# read from log.dat, remove unprintable characters, save as replog.dat
cat $LOG_DIR/log.dat | tr -cd '\11\12\15\40-\176' > $LOG_DIR/replog.dat
# overwrite log.dat with fixed file
mv $LOG_DIR/replog.dat $LOG_DIR/log.dat
# for more info see: https://alvinalexander.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix