~rsandifo/+junk/loop-microbenchmarks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -eu

base="/tmp/eembc.exe"

userat=
userl=
command=$base
if test $# -gt 0; then
  case $1 in
    --root)
      userat=root@
      userl="-l root"
      command="nice -20 $command"
      shift
      ;;
  esac
fi

if test $# -lt 2; then
  echo >&2 "Usage: $0 [--root] <board> <command>"
  exit 1
fi

board=$1; shift
exe=$1; shift

scp -C "$exe" "$userat$board:$base"
exec ssh ${board} $userl "$command"