So basically what you are trying to do is
- Iterate through strings printed by
svn info --revision HEAD - From line 5
- Assignment of the 2nd element / field / column to the variable
%%G
One of the many ways to do this in Bash is
for variable in $(svn info --revision HEAD | awk 'NR>4 {print $2}'); do ... something fun ... done
What does it mean is
- You send / "send" the output of the
svn info --revision HEAD to awk . - If NR (the number of processed records / rows) is greater than 4 (i.e., skips the first 4 rows),
awk displays the 2nd column / field / element. Then all $(..) is replaced by awk , something like
item2_line5 item3_line6 item2_line7 ....
Due to the separation of the words Bash, each line is considered as an element in the list, and for iterates through each element in the list.
source share