Find Jobs
Hire Freelancers

Bash Shell Script

$30-250 USD

In Progress
Posted about 15 years ago

$30-250 USD

Paid on delivery
I want to have four functions written in bash shell scripting Function-1 (insert_record) It will take four variables: $name , which is will passed as an argument to the function. The function may receive the name in one word as for example “smith” or two words or more like “Joy Smith Macline” in this case the function should replace the space with ‘_’ so it would be like $name=”Joy_Smith_Macline” $Phone, which is will passed as an argument to the function, example $phone=”00123456789”. $start_date, which the current date on the server but in the following format (hh:mm:dd:mm:yy). $end_date, it would be a fixed variable which has a fix value ‘0’. These values will be inserted into a file called “worklogs” Sample file of worklogs: Joy_Smith_Macline 00123456789 11:23:18:09 0 But if there is a record with same phone number and end_date=’0’, then it should break with error message, and if the record with the same number but end_date=(hh:mm:dd:mm:yy), then you can add the record. Function2-Read _file It will read worklog, and it will print only the records that has the value for $end_date as ‘0’ but also when it will show Joy_Smith_Macline as Joy Smith Macline that mean it will return the space in between words (on the screen only but in the file you should keep it as it, Joy_Smith_Macline). So the output after calling this function on the screen: Joy Smith Macline 00123456789 11:23:18:09 0 Function3-Update_file For this function you have to pass the phone number $phone as an argument . Then the function has to open the file and search for the line that has the same phone number but with date_end=0, once it find it will replace it with current date and time (hh:mm:dd:mm:yy), notice that there might be more than one record with the same number, if the date_end=0 update it to the current date and ignore the one with end_date is define in the format (hh:mm:dd:mm:yy). So as a summary if ($phone =001234567&end_date=’0’) then update Else print error message. Function4-Check_record You will pass the $phone as argument and you will check in the file if there is any record in the file with the same number and end_date=0 , if it’s there return 1 other wise return 0. I want these functions to be ready within 12 hour and My budget for this task is 50$
Project ID: 372734

About the project

3 proposals
Remote project
Active 15 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED ARAB EMIRATES
Sharjah, United Arab Emirates
5.0
79
Payment method verified
Member since Jul 27, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.