Find Jobs
Hire Freelancers

Bash Shell Script

$30-250 USD

Igangværende
Slået op cirka 15 år siden

$30-250 USD

Betales ved levering
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$
Projekt-ID: 372734

Om projektet

3 forslag
Projekt på afstand
Aktiv 15 år siden

Leder du efter muligheder for at tjene penge?

Fordele ved budafgivning på Freelancer

Fastsæt dit budget og din tidsramme
Bliv betalt for dit arbejde
Oprids dit forslag
Det er gratis at skrive sig op og byde på jobs

Om klienten

Flag for UNITED ARAB EMIRATES
Sharjah, United Arab Emirates
5,0
79
Betalingsmetode verificeret
Medlem siden jul. 27, 2008

Klientverificering

Tak! Vi har sendt dig en e-mail med et link, så du kan modtage din kredit.
Noget gik galt, da vi forsøgte at sende din mail. Prøv venligst igen.
Registrerede brugere Oprettede jobs i alt
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Indlæser forhåndsvisning
Geolokalisering er tilladt.
Din session er udløbet, og du er blevet logget ud. Log venligst ind igen.