SCRIPT REFERENCES
Advanced Bash-Scripting Guide, a tutorial and reference for writing Linux bash shell scripts
ARCHIVING
Create a tarball that is split into 'chunks' for emailing and later reassembly:
Create tarball in 'chunks':
tar -cvpf - SRC_DIR/* | split -d -b 1M - PREFIX (e.g. "tar -cvpf - g870/* | split -d -b 1M - fw")
Reassemble chunks:
cat PREFIX* | tar -xpvf - (e.g. cat fw* | tar -xpvf -)
FILE PROCESSING
Remove non-ASCII characters from a file:
tr -cd '\t\n[:print:]' < SOURCE_FILE > TARGET_FILE
MOUNTS AND SYMBOLIC LINKS
Mount part of a mounted filesystem to another mount point:
mount -o bind /DIR_TO_MOUNT /NEW_MOUNT_POINT
e.g. "mount -o bind /mtd0/opt/ /opt/" mounts the /mtd0/opt/ directory on the mounted /mtd0 filesystem to the /opt directory
CONVERTING TO UPPER- OR LOWER-CASE
Using the 'tr' command:
echo "This is some Sample TEXT" | tr '[:upper:]' '[:lower:]'
Another option:
TEST="This Is A Test"
UPPER=$(echo ${TEST^^})
LOWER=$(echo ${TEST,,})