Search code examples
basharduinorfid

RFID USB reader terminal reading with Bash


I bought an RFID USB kit and haven't been able to read the RFID IDs with the following Bash script.

#!/bin/bash

while [ read -r rfid ] ; do

#URL=http://www.mainpage.us/rfid/status.php?number=$rfid

#curl --request POST $URL

echo $rfid
sleep 1

done < /dev/cu.usbserial-A600JNHR

The RFID should work fine as per the terminal. What am I doing wrong?


Solution

  • [ is a command. Since you want to use read, you should not try to use [.