From 77c4968342440c37e5d780736e6d0dab938498e2 Mon Sep 17 00:00:00 2001
From: Andrew Tridgell <tridge@samba.org>
Date: Sun, 5 Jan 2014 21:23:48 +0800
Subject: [PATCH] AP_NavEKF: enable plotting in plot2.dat too

---
 libraries/AP_NavEKF/examples/AP_NavEKF/plotit.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libraries/AP_NavEKF/examples/AP_NavEKF/plotit.sh b/libraries/AP_NavEKF/examples/AP_NavEKF/plotit.sh
index 28179e0998..59a2fea56f 100755
--- a/libraries/AP_NavEKF/examples/AP_NavEKF/plotit.sh
+++ b/libraries/AP_NavEKF/examples/AP_NavEKF/plotit.sh
@@ -1,12 +1,21 @@
-#!/bin/sh
+#!/bin/bash
 
 cmd="plot "
 echo $#
 while [ $# -gt 1 ]; do
-    cmd="$cmd 'plot.dat' using 1:'$1',"
+    if [[ "$1" == *.* ]]; then
+        cmd="$cmd 'plot.dat' using 1:'$1',"
+    else
+        cmd="$cmd 'plot2.dat' using 1:'$1',"
+    fi
     shift
 done
-cmd="$cmd 'plot.dat' using 1:'$1'"
+if [[ "$1" == *.* ]]; then
+    cmd="$cmd 'plot.dat' using 1:'$1'"
+else
+    cmd="$cmd 'plot2.dat' using 1:'$1'"
+fi
+echo $cmd
 cat <<EOF > _plot.gnu
 set style data lines
 set xlabel "time(s)"