#!/bin/bash

emp_info=(
aaa 13800000000 aaa@qq.com
bbb 13800000001 bbb@qq.com
ccc 13800000002 ccc@qq.com
ddd 13800000003 ddd@qq.com
eee 13800000004 eee@qq.com
)

for i in ${!emp_info[@]}
do
    if [ `expr $i % 3` = "2" ] # get mail addr
    then
        name=${emp_info[`expr $i - 2`]}
        mailaddr=${emp_info[$i]}
        mobile=${emp_info[`expr $i - 1`]}
        echo $name $mobile $mailaddr
    fi
done

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-02-20
  • 2021-05-02
  • 2021-08-03
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2022-02-25
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案