Skip to content

Instantly share code, notes, and snippets.

@hobs
Created July 22, 2010 20:51
Show Gist options
  • Save hobs/486575 to your computer and use it in GitHub Desktop.
Save hobs/486575 to your computer and use it in GitHub Desktop.
#!/bin/bash
#read stream
args=("$@")
#discard =Breaks=
res=`sed '1p' ${args[0]}`
while read -r line; do
do
if $line=="==============================================="
then make a new array item
else
append line to current array position
fi
done <<< "$res"
# Contents of args[0]
# =Breaks=
# ===============================================
# Entered Break at 1:46 PM
# Left Break at 2:06 PM
# ===============================================
# Entered Break at 7:17 PM
# Left Break at 7:32 PM
# ===============================================
# Entered Break at 7:17 PM
# Left Break at 7:32 PM
# ===============================================
# Entered Break at 7:17 PM
# Left Break at 7:32 PM
# ===============================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment