Reputation
13,933
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
10 56 113
Impact
~1.2m people reached

Jan
22
awarded  Popular Question
Jan
2
awarded  Nice Question
Dec
13
awarded  command-line
Dec
11
awarded  Nice Answer
Dec
4
awarded  Nice Question
Nov
19
awarded  Notable Question
Nov
17
awarded  Good Question
Nov
12
awarded  Popular Question
Nov
11
awarded  Famous Question
Oct
22
awarded  Popular Question
Oct
19
awarded  Yearling
Oct
15
awarded  Popular Question
Oct
13
awarded  Notable Question
Oct
5
awarded  Nice Question
Oct
2
awarded  Famous Question
Sep
29
awarded  Famous Question
Sep
28
awarded  Notable Question
Sep
11
comment Explanation of the use of false and true in a while loop
... just something I should have added to my previous comment: foo=true; $foo && echo $foo is true -- In this case, the $foo in $foo && is being used as the condiiton test. The shell expands $foo to true, and because of its position in the code the true is treated as the builtin (not as a string) -- The exit code from an executable is valid in a contition test.
Sep
11
comment Explanation of the use of false and true in a while loop
... true as a builtin in a condition test which prints out true is true: foo=true; if true; then echo $foo is true; fi or foo=true; true && echo $foo is true -- basically the question's code is somewhat confusing because it uses special "words" as variable names; namely do, done, true, false
Sep
11
comment Explanation of the use of false and true in a while loop
true and false are shell builtins. (as are : and printf). You can run true and false at the commandline. They respectively exit with codes 0 and 1 -- note that unlike boolean true, bash true has a value of 0 -- However if you use them as the assignment value of a variable, then they are just text.