Question please help,
I tried everything trying to run this question on my linux.
please let me know what I need to do? question: "What is wrong with the following lines of code? While [ "$value" = "100" ; do Echo "Thats a large number." fi" what I did: what I did: while ["value" = "100"] ; do My instructor reply: Answer: 1) there should be a closing bracket after 100, 2) Echo should not have an initial capital letter, 3) there should be a semicolon on the second line to separate number. and read value, and the third line should have done instead of fi. explain to me what I'm missing... please and thank you |
By taking the $ away from $value you've changed it from a variable to a fixed string of the word value
And as for the rest, your instructor is correct, what parts don't you understand? |
I didn't understand when my instructor says
3) there should be a semicolon on the second line to separate number. and read value, and the third line should have done instead of fi. I run the command line but it gave me this: user@user-HP-Compaq-nc6400-EH521AV:/home$ while ["value" = "100"] ; do > explain why my instructor says: "there should be a semicolon on the second line to separate number. and read value, and the third line should have done instead of fi." which I don't know where and when I should input fi in the command at all |
You were given part of a script to debug, not a command line.
|
So all i need to debug is
while ["value" = "100" ; do > echo "that's a large number" ???? |
Have a look at
http://mywiki.wooledge.org/BashGuide...ndConditionals |
Quote:
However, you could put everything in one line, and would need semicolons then (untested): Code:
while [ "$value" = "100" ]; do; echo "That's a large number."; done |
Awesome! Thanks guys! Yooden U the best...! I didn't know I was only missing the "done" part in the end. hahaa
|
All times are GMT -5. The time now is 07:02 PM. |