NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » LEDArray - Bash question

March 08, 2010
by gplouffe
gplouffe's Avatar

I am struggling with bash syntax and was hoping someone could help me sort it out. The following was working but I made some changes to the date format and (rookie move) did not have a backup. Now I am getting a syntax error on a line that worked fine before.

Here is the script. Pretty simple but this generates a syntax error noted below:



CURRENTDATE=$(date +%m%d%Y)


tweets=$(twidge lsrecent -su ) if [[ -n "$tweets" ]] ; then

tweets=$( echo "$tweets" | tr '[:lower:]' '[:upper:]' ) echo $tweets > $lcdtext


echo "no tweets"


The error I am getting is as follows: File "", line 11 CURRENTDATE=$(date +%m%d%Y) ^ SyntaxError: invalid syntax

March 08, 2010
by gplouffe
gplouffe's Avatar

Apparently I need to take a break.... Working fine now. Had a problem between the keyboard and the floor...was executing as a python script vs a bash script...yeesh

March 10, 2010
by mcai8sh4
mcai8sh4's Avatar

just as a comment, you need a hash at the beginning, ie.



Post a Reply

Please log in to post a reply.

Did you know that the microcontroller's crystal oscillator can be used to keep accurate time? Learn more...