Debian Codegraph @

csubloop.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # csubloop.sh: Setting a variable to the output of a loop.
3
4 variable1=`for i in 1 2 3 4 5
5 do
6 echoscip-shell system . . echo. -n "$i" # The 'echo' command is critical
7 done` #+ to command substitution here.
8
9 echoscip-shell system . . echo. "variable1 = $variable1" # variable1 = 12345
10
11
12 i=0
13 variable2=`while [scip-shell system . . `[`. "$i" -lt 10 ]
14 do
15 echoscip-shell system . . echo. -n "$i" # Again, the necessary 'echo'.
16 let "i += 1" # Increment.
17 done`
18
19 echoscip-shell system . . echo. "variable2 = $variable2" # variable2 = 0123456789
20
21 # Demonstrates that it's possible to embed a loop
22 #+ inside a variable declaration.
23
24 exit 0