Personnel pay before the payroll is sent to our mailbox, look at the personnel sister paper is a kind and beautiful gu cool, so wrote a shell code to achieve bulk text to each mobile phone number. Not much to say, on the code, in fact, very simple, I am embarrassed to upload, or record it, later can be blown. The principle is that the calendar salary.csv in every piece of data, this code is the most powerful jar package, not the jar package, I do not use this code, tomorrow to upload an email to achieve the same function of the shell code.
#!/bin/bashsendmsg="/data/x5online/sendphonemsg.jar"Detailtxt="Salary.csv" whileRead Line DoName=`Echo$line |awk '{print $}'' Phone=`Echo$line |awk '{print $}'' Totalsalary=`Echo$line |awk '{print $}'' Othersalary=`Echo$line |awk '{print $4}'' Kaoqingkouchu=`Echo$line |awk '{print $}'' Shebaokouchu=`Echo$line |awk '{print $6}'' Gongjijingkouchu=`Echo$line |awk '{print $7}'' Personaltax=`Echo$line |awk '{print $8}'' Reallysalary=`Echo$line |awk '{print $9}'` /usr/bin/java-jar ${sendmsg} ${phone} Dear ${name}, your salary for this month is ${totalsalary}, the other payroll totals are ${othersalary}, the attendance deduction is ${kaoqingkouchu}, Social Security deduction is $ {Shebaokouchu}, Provident Fund deduction for ${gongjijingkouchu}, personal tax deduction for ${personaltax}, real pay for ${reallysalary}, and finally wish you a pleasant work. Done< $Detailtxt
Shell Code
A Payroll Shell Code