Another issue with the 09MAY17 "2-Bullet Tuesday" code (on my system -- Windows running Cygwin, ssh-ing into Omega2) is the line that calls ubidots.

The line needs to be modified to read as follows (note type and location of quotation marks):

ubidots -t $TOKEN -d $DEVICE set '{free-"memory":'$freeMem'}'

I hope this helps.