I have never used arrays before but I have a script like this:
var1=$(for i in $(cat /tmp/jobs.021013);do $LIST -job $i -all |
perl -ne 'print /.*(\bInfo.bptm\(pid=\d{3,5}).*/' | tr -d "(Info=regpid" | tr -d ')'; $LIST -job $i -all |
cut -f7 -d','| sed -e "s/^\([0-9]*\)\([A-Z0-9.-]*\)\([-0-9-]*\)\(.*\)/\1 \2/";done)
echo $var1
var2=$(for i in $(cat /tmp/jobs.021013);do $LIST -job $i -all |
perl -ne 'print /.*(\bInfo.bptm\(pid=\d{5}).*/' | tr -d "(Info=regpid" | tr -d ')'; $LIST -job $i -all |
cut -f7 -d','| sed -e "s/^\([0-9]*\)\([A-Z0-9.-]*\)\([-0-9-]*\)\(.*\)/\1 \2/";done)
echo $var2
These two variables will store a list such as: Var1= 996 host1 665 host2 334 host3
and Var2 =15516 host1 22223 host2 15151 host3. However, I want a list that looks like this:
996 15516 host1
665 22223 host2
334 15151 host3
Would I need to use arrays to get a list like this? If so, what would be a brief example? Any suggestions would be greatly appreciated.
---------- Post updated at 12:34 PM ---------- Previous update was at 12:25 AM ----------
Did anyone have an idea about creating this list? Do you need more information?