A brother in the forum to toss two variables at the same time, do not know how to toss. Later learned that you can use an array
All forget the shell and the array.
wrote a test program. Record it. I also have an impression in the future.
#!/bin/bashdeclare -a tmpfor i in $ (find /bin -type f) do let c++ tmp[c]= "$i" donelen= "${#tmp [@]}" #array lengthc =200for i in $ (find /usr/bin -type f) do let c++ tmp[c]= "$i" donei=0while [ $i -le $len ]do let i+=1 echo "bin:${tmp[i]}; usr:${tmp[i+200]}" Done$ bash a.sh bin:/bin/cp usr:/usr/bin/semodule_linkbin:/bin/redhat_lsb_init usr:/usr/bin/ gst-launchbin:/bin/readlink usr:/usr/bin/opgprofbin:/bin/unicode_start usr:/usr/bin/eu-stringsbin:/ bin/ps usr:/usr/bin/pango-querymodules-64bin:/bin/lsblk usr:/usr/bin/wbin:/bin/sleep usr:/usr/ bin/smbta-utilbin:/bin/setserial usr:/usr/bin/aserverbin:/bin/unicode_stop usr:/usr/bin/patchbin:/ bin/cgget usr:/usr/bin/Pdftopsbin:/bin/nano usr:/usr/bin/lzmainfobin:/bin/cgdelete usr:/usr/bin/gstackbin:/bin/ln usr :/usr/bin/rngtestbin:/bin/mkdir usr:/usr/bin/nfs4_setfaclbin:/bin/mknod usr:/usr/bin/vimtutorbin:/ Bin/dumpkeys usr:/usr/bin/op-check-perfeventsbin:/bin/ipcalc usr:/usr/bin/sedispolbin:/bin/gzip usr:/usr/bin/reporter-mailxbin:/bin/true usr:/usr/bin/tiff2pdfbin:/bin/mv usr:/usr/bin/ urlgrabberbin:/bin/dbus-uuidgen usr:/usr/bin/grofferbin:/bin/cgsnapshot usr:/usr/bin/smbcquotasbin:/ bin/env usr:/usr/bin/nfs4_getfaclbin:/bin/arch usr:/usr/bin/repomanagebin:/bin/echo usr:/usr/ Bin/eu-unstripbin:/bin/touch usr:/usr/bin/.ssh.hmac
The first time the script takes the result length is the maximum length of the back while.
Arrays can also be directly
For i in ${array[@]}; Do ...; Done
But to take two variables at the same time is not good toss.
In addition to the array there are shards, replacements and other advanced features, this is not currently available. Don't write it.
Or toss Python-based ...
Shell array using