syntax error near unexpected token 'done' (Bash scripting, first time, loops)
Hi,
I just wrote my first script to learn some of the basic syntax and I've run into a problem. I can't tell what i'm doing wrong: Code:
#!/bin/bash Quote:
It must be something in the way I've written it, and not a problem with the loop syntax. Can anyone tell? EDIT: apparently my guide omitted the fi after elif, so I thought they were unnecessary. Protip: they are necessary. |
You can debug your script by using set -xv (x stands for execution and v for verbose) in your script to check where it produces error, as follow:-
Code:
#!/bin/bash |
Please do not edit original data from a post as you may help others with your question which they now do not know if it was the same scenario.
As for marking SOLVED, please use the Thread Tools option provided. |
Moderator note: please don't trash your threads! As grail pointed out, questions and answers posted at LinuxQuestions feed the LQ knowledge base and may serve others to learn something. Whatever the question be! Please, refrain from doing that in the future. Thread closed, since it's useless now (if by chance you want to restore the original content, please contact me or use the REPORT button in the lower-right corner of your post).
|
All times are GMT -5. The time now is 06:23 AM. |