Linux

mydumpsplitter - Extract tables from mysqldump

http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/

#!/bin/sh
# http://kedar.nitty-witty.com
#SPLIT DUMP FILE INTO INDIVIDUAL TABLE DUMPS
# Text color variables
txtund=$(tput sgr 0 1)    # Underline
txtbld=$(tput bold)       # Bold
txtred=$(tput setaf 1)    # Red
txtgrn=$(tput setaf 2)    # Green
txtylw=$(tput setaf 3)    # Yellow
txtblu=$(tput setaf 4)    # Blue
txtpur=$(tput setaf 5)    # Purple
txtcyn=$(tput setaf 6)    # Cyan
txtwht=$(tput setaf 7)    # White
txtrst=$(tput sgr0)       # Text reset
 
TARGET_DIR="."
DUMP_FILE=$1

Linux - Remove Null Values from files

#!/bin/bash
DIR=$1;
#	Created By Aaron Moline Aaron.Moline@molinesoftware.com
#	Date: 02/26/2010
#	Description: Enumerate each file $DIR and remove null values
#	Version: 1.0
#
for file in $DIR/*.*
do
        od -b < $file | grep ' 000 ' > nullchk
        CMD=$[ $(cat nullchk | grep '000' | wc -l) ]
 
        if [ $CMD -gt 0 ]; then
                tr -d '\000' < $file > tmp
                mv tmp $file
                echo "Cleaned File: " $file
        fi
    continue
done
rm nullchk