sendTextFile.sh 345 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. if [ $# -eq 0 ]
  3. then
  4. echo "No file to send"
  5. exit 1
  6. fi
  7. echo "Converting $1 to wordfile"
  8. # Get base name of file
  9. filename=$(basename -- "$1")
  10. xxd -p -c 1 $1 | sed 's/\(..\)/000000\1/g' | xxd -r -p > wordfile
  11. echo "Sending wordfile to FPGC"
  12. python3 netUpload.py wordfile $filename
  13. echo "File sent"
  14. # Clean up
  15. rm wordfile