ardupilot/Tools/Replay/plotit.sh
Richard Marko 04b46678a4 treewide: fix shebangs - /bin/bash -> /usr/bin/env bash
Most scripts/tools use non-portable `/bin/bash`, switch
to environment agnostic `/usr/bin/env bash`.
2024-02-13 11:36:23 +11:00

27 lines
461 B
Bash
Executable File

#!/usr/bin/env bash
cmd="plot "
echo $#
while [ $# -gt 1 ]; do
if [[ "$1" == *.* ]]; then
cmd="$cmd 'plot.dat' using 1:'$1',"
else
cmd="$cmd 'plot2.dat' using 1:'$1',"
fi
shift
done
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)"
$cmd
pause -1 "hit return to exit"
EOF
gnuplot _plot.gnu