Invoice - A small shell script to run via cronjob

Befejezett Kiadva: 2 évvel ezelőtt Kiszállításkor fizetve
Befejezett Kiszállításkor fizetve

I need a small script that can solve the following task

1. At the top of the file, the path to the log file must be defined so that it only needs to be changed 1 place if it needs to be changed.

2. It should do the following 3 searches

cat / var / log // full | grep "CALLERID (name) =" | grip Rentokil- | wc -l

Output example: 150

cat / var / log // full | grep "CALLERID (name) =" | grip Rentokil1- | wc -l

Output example: 198

cat / var / log // full | grep "CALLERID (name) =" | grip Rentokil2- | wc -l

Output example: 12

3. It must calculate the price

Calculation for Rentokil-

it must use output - 20 * 7 and add 290. - If out is 20 or below, then the price must always be 290

So 150 - 20 = 130. 130 * 7 = 910. 910 + 290 = 1200

The result here is 1200

Calculation for Rentokil1-

If the output is

0-10 the price must be 475

11-50 the price must be 699

51-100 the price must be 999

101-150 the price must be 1299

151-200 the price must be 1599

201-250 the price must be 1999

251-300 the price must be 2399

If the output is above 300, then number * 7

The result here is 198, so the price is 1599

Calculation for Rentokil3-

it must use output - 20 * 7 and add 290. - If out is 20 or below, then the price must always be 290

So since the output is 12, the result should ALWAYS be 290

The result here is 290

4. The result must be entered in the mysql database

update product SET product_name = 'Rentokil agreed price for 150 calls', product_price = '1200' WHERE `pl_id` = '572';

update product SET product_name = 'Rentokil1 Up to 200 phone calls per. month ', product_price =' 1599 'WHERE `pl_id` =' 573 ';

update product SET product_name = 'Rentokil2 agreed price for up to 20 calls', product_price = '290' WHERE `pl_id` = '574';

This SQL command

"update product SET product_name = 'Rentokil agreed price for 150 calls', product_price = '1200' WHERE` pl_id` = '572'; "

There it must ALWAYS change Rentokil to the name it gets output for

It must ALWAYS change 150 to the actual output number, but if the output is less than 20, then it must say 20.

This SQL command

"update product SET product_name = 'Rentokil1 Up to 200 phone calls per month', product_price = '1599' WHERE` pl_id` = '573'; "

There it must ALWAYS change Rentokil1 to the name it gets output for

It must change 200 to the last number in the price, that is, it must either write 10, 50, 100, 150, 200, 250, 300 or if it is more than 7, then the actual output number

This SQL command

update product SET product_name = 'Rentokil2 agreed price for up to 20 calls', product_price = '290' WHERE `pl_id` = '574';

It's like Rentokil

Deadline 1 days MAKS

Shell script Linux

Projektazonosító: #31000389

A projektről

2 ajánlat Távolról teljesíthető projekt Utoljára aktív: 2 évvel ezelőtt

Odaítélve:

nurub

Hi I can work with you to prepare this shell script to do the processing that you explained in your project I just need to understand some stuff to start working on it Please contact me in chat Thanks

$120 USD 1 napon belül
(0 értékelés)
0.0

2 szabadúszó tett átlagosan 145$ összegű árajánlatot erre a munkára

mundvlp

Hi, I realize you need the script ready urgent. Please allow me to help you with this. Still it will take at least 2 day to test and catch exceptions. Thanks.

$170 USD 2 napon belül
(0 vélemény)
0.0