O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

23.1. Common errors

23.1.1. The loop error

Errors that are reported on the for, while, until or case statements mean the actual statement block is incorrect. You have missed out a reserved word for that construct.

The following error below reports the word ‘done’, which is a good clue, since you know it is something to do with a while statement. Looking back through your code check out the while statement for any missing words, like ‘ do ’, or the conditional statement you are using.

syntax error near unexpected token ‘done’ 
line 31: ‘ done’

23.1.2. The classic missing quote

The second error is the classic missing quote error. Learn to like this one, because you will see a lot of these. The only solution I offer on this type of error is to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required