I am trying to run the command mention below to get the status of the DataStage job in a script,
JOBSTATUS = $(dsjob -jobinfo "$Project_Name" "$Job_Name" | head -l | cut -d"(" -f2 | cut -d")" -f1)
echo $JOBSTATUS
I tried using (Tilde)
JOBSTATUS = `dsjob -jobinfo "$Project_Name" "$Job_Name" | head -l | cut -d"(" -f2 | cut -d")" -f1`
echo $JOBSTATUS
But still getting the error:
JOBSTATUS: not found [no such file or directory]
At the same time if try to run this command in command line, it is running fine and giving the output.
I am new to Unix, am I missing anything?