"Numeric Argument Required" Error in Shell Script

"Numeric Argument Required" Error in Shell Script
#!/bin/sh

get_json_response(){
  status=$1
  mode=$2
  errorcode=$3
  json_response=`python getJsonResponse.py $status $mode $errorcode`
  return json_response
}

get_json_response 0 0 0 

I get the following error when I try to run the above code -

./tryfunction.sh

./tryfunction.sh: line 8: return: json_response: numeric argument required

How should I rectify this error?

2
Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.