fakecompare 765 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. #
  3. # Compare the results from running gpsfake on a logfile between this
  4. # machine and a remote one. Especially useful when remote and local
  5. # have different word lengths.
  6. #
  7. # This file is Copyright 2010 by the GPSD project
  8. # SPDX-License-Identifier: BSD-2-clause
  9. # BSD terms apply: see the file COPYING in the distribution root for details.
  10. #
  11. file=$1
  12. remote=$2
  13. directory=git/gpsd
  14. options="-D 4"
  15. ./gpsfake $options -s 38400 -1 -p $file >/tmp/fcmp-local-$$ 2>&1
  16. scp -q $file ${remote}:${directory}
  17. ssh $remote "cd ${directory}; PATH=$PATH:. ./gpsfake $options -s 38400 -1 -p $file" >/tmp/fcmp-remote-$$ 2>&1
  18. echo "*** Local:"
  19. cat /tmp/fcmp-local-$$
  20. echo "*** Diff:"
  21. diff -u /tmp/fcmp-local-$$ /tmp/fcmp-remote-$$
  22. rm /tmp/fcmp-local-$$ /tmp/fcmp-remote-$$