Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

asked on

how to search/update a property value in bash

How to update status value using function and passing JOB_NAME and STATUS value and get the response code

Function trying to come up with
=======================================
#!/bin/bash

function CallStatusUpdate(){
  aJobName=$1
  ajobCurrentStatus=$2

  # Search for $1 (job_1) and update job_1_status=$2 (job_1_status="started")

}


returncode=$(CallStatusUpdate "job_1" "started")
echo $returncode

=======================================



Input Task.txt
==============
job_1_name=job1
job_1_asset=task1
job_1_dependent_on="none"
job_1_status="not started"
job_1_description="description of task1"
job_1_arg1="some arg1"
job_1_arg2="some arg2
job_1_arg3="some arg3"
job_1_arg4=none
job_1_arg5=none

job_2_name=job2
job_2_asset=task2
job_2_dependent_on="job1"
job_2_status="not started"
job_2_description="description about this task"
job_2_arg1="some arg1"
job_2_arg2="some arg2
job_2_arg3="some arg3"
job_2_arg4=none
job_2_arg5=none

job_3_name=job3
job_3_asset=task3
job_3_dependent_on="job1,job2"
job_3_status="not started"
job_3_description="description about this task"
job_3_arg1="some arg1"
job_3_arg2="some arg2
job_3_arg3="some arg3"
job_3_arg4=none
job_3_arg5=none
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enthuguy

ASKER

Thanks ozo, as always :)