Skip to main content
added 92 characters in body
Source Link
user4556274
  • 9.4k
  • 2
  • 35
  • 38

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true; you cannot arbitrarily replace newlines with semicolons, as you have done to convert your. Your multiline script can be converted to a single line as long as you observe the formabove syntax rules and do not insert an extra semicolon after the do:

for i in `seq 1 10`; do;do echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true; you cannot arbitrarily replace newlines with semicolons, as you have done to convert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true; you cannot arbitrarily replace newlines with semicolons. Your multiline script can be converted to a single line as long as you observe the above syntax rules and do not insert an extra semicolon after the do:

for i in `seq 1 10`; do echo $i; done 
Tweaked punctuation.
Source Link

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true:true; you cannot arbitrarily replace newlines with semicolons, as you have done to convert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true: you cannot arbitrarily replace newlines with semicolons, as you have done to convert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true; you cannot arbitrarily replace newlines with semicolons, as you have done to convert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 
added 29 characters in body
Source Link
user4556274
  • 9.4k
  • 2
  • 35
  • 38

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true: you cannot arbitrarily replace newlines with semicolons, as you have done to getconvert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true: you cannot arbitrarily replace newlines with semicolons, as you have done to get the form:

for i in `seq 1 10`; do; echo $i; done 

The syntax of a for loop from the bash manual page is

for name [ [ in [ word ... ] ] ; ] do list ; done 

The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands."

However, the reverse is not true: you cannot arbitrarily replace newlines with semicolons, as you have done to convert your multiline script to the form:

for i in `seq 1 10`; do; echo $i; done 
Source Link
user4556274
  • 9.4k
  • 2
  • 35
  • 38
Loading