User Tools

Site Tools


linux:bashshell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
linux:bashshell [2016/07/08 07:13] – [Manipulating String] adminlinux:bashshell [2017/01/12 02:12] – external edit 127.0.0.1
Line 331: Line 331:
 </code> </code>
 ==== update array to file ==== ==== update array to file ====
 +Below is array configs.txt:<code>
 +c1 = 0,4,5,8,9,12,13,16,17,19,22,21,45,2,3,6,7,10,11,14,15,20,1,23,44,50,26,27,28,29,30,31,32,33,34,35,38,49,47,18,36,37,24,39,40,41,42,43,46,48,25,51
 +c2 = 51,4,5,8,9,12,13,16,17,25,22,21,45,2,3,6,7,10,11,14,15,20,1,23,44,50,26,27,28,29,30,31,32,33,34,35,38,49,47,18,36,37,24,39,40,0,42,43,46,48,19,41
 +c3 = 26,27,33,34,8,9,12,13,40,41,0,30,31,2,3,6,7,10,11,14,15,20,21,23,44,50,45,1,28,29,32,19,22,4,5,35,38,49,47,18,36,37,24,39,16,17,42,43,46,48,25,51
 +</code>
 +update array to files:
 <code bash> <code bash>
-index=0;for i in `cat configs.txt | awk '{print $3}'`; do let "index = $index + 1";echo $i > c$index; done+index=0;for i in `cat configs.txt | awk '{print $3}'`; do let "index = $index + 1";echo $i > c$index.txt; done
 </code> </code>
linux/bashshell.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1