while true; do ping -c1 8.8.8.8; sleep 5; done
LASTTOKEN='' while read t; do echo $t LASTTOKEN=$t done < apitokens.txt
!/bin/bash
2012-07-14 johnpfeiffer
function alphabetical() { if [ $# -ne 1 ]; then echo "function alphabetical requires a parameter" exit 0 fi
# includes hidden directories by using . SOURCEDIRS="$1/." for dir in $SOURCEDIRS; do if [ -d $dir ]; then du -sh $dir fi done
SOURCEDIRS="$1/*" for dir in $SOURCEDIRS; do if [ -d $dir ]; then du -sh $dir fi done } # end alphabetical
main
if [ $# -ne 1 ]; then echo "$0 requires a directory to start from, usage: $0 /path" exit 0 fi
echo "$0 listing $1 subdirectories and their sizes with du -sh" alphabetical $1
!/bin/bash
iterate the subdirectories/WEB-INF/app.properties and
compare a text file within to a similarly organized TEMP directory
SOURCE=./* # all of the items in the current directory TARGET=/home/ubuntu/ARCHIVE
for DIRECTORY in $SOURCE; do if [ -d "$DIRECTORY" ]; then DIRECTORYNAME=${DIRECTORY##*/} # extract after the last / echo $DIRECTORYNAME ls $DIRECTORY/WEB-INF/ diff $DIRECTORY/WEB-INF/app.properties $TARGET/$DIRECTORYNAME/WEB-INF/app.properties -w #ignore whitespace/line endings fi done