Commit 00cd6c89a2b2ad6da2cd091663c5584a476a87b0

  • avatar
  • Jarkko Vilhunen <jarkko.vilhunen @j…u.fi> (Committer)
  • Mon Mar 28 10:50:25 EEST 2011
  • avatar
  • Jarkko Vilhunen <jarkko.vilhunen @j…u.fi> (Author)
  • Mon Mar 28 10:50:25 EEST 2011
Simple utility to separate sensor outputs to different files
filter.sh
(19 / 0)
  
1#!/bin/bash
2
3
4SENSORS="acceleration0 acceleration1 acceleration2 temperature vibration humidity"
5function filter {
6 grep $2 $1 | sed "s/ [a-z][a-z]*[^C9]* / /g" >> $2
7}
8
9if [ ! -f $1 ]
10then
11 echo "File not found: $1"
12else
13 echo "This might take a while" #grep is slow
14 for i in $SENSORS
15 do
16 echo "Generating $i..."
17 filter $1 $i
18 done
19fi