MySQL Union table query script:
#!/bin/shkkmailmysqlpass=$ (cat /usr/local/kk-mail/config/custom.conf | grep -w "Pass" | awk -f " " ' {print $NF} ')/usr/local/kk-mail/service/mysql/bin/mysql -u kkmail -p$kkmailmysqlpass kkmail -e "Select b.realname,a.mailbox,a.quota_ Mailbox,a.quota_netdisk,a.limit_send,a.limit_recv,c.position,d.title from core_mailbox a,co_ user b,co_department_member c,co_department d where a.mailbox_id=b.mailbox_id and a.mailbox_id=c.mailbox_id and c.dept_id=d.id; " >/root/user.txtawk ' begin{ofs= ' \ t '} {if ($5==-1) {$5= "Unrestricted"}if ($5==1) {$5= "Forbidden"}if ($5==2) {$5= "this domain "}if ($5==3) {$5=" designation "}if ($5==4) {$5=" Local all Domains "}if ($6==-1) {$6=" Unrestricted "}if ($6==1) {$6=" Forbidden "}if ($6==2) {$6=" This domain "}if ($6==3) {$ 6= "Specify the Other"}if ($6==4) {$6= "Local all Domains"}print} ' /root/user.txt >/root/user2.txtcat user2.txt |sed 1d | sed ' 1i\ name email capacity network disk send receive Jobs Department ' >/root/user3.txt
MySQL Union table query script