0

I am executing one shell script, which contains the following curl command.

FIRST=`curl -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'How-Many: 1' -d '{"filters": { "jobstreamFilter": { "jobStreamName":"'$JOBSTREAM_NAME'","workstationName": "'$WORKSTATION_NAME'"}}}' https://$IWA_HOST:31116/twsd/model/jobstream/header/query -H "Authorization: Basic $CREDS"`

When I execute the shell script from CLI it works fine, but when I call the script from the application, this curl command is not executed. The rest of all the echo statements in the script are printing except FIRST.

wcarhart
  • 2,685
  • 1
  • 23
  • 44
Dip
  • 1
  • 1
  • 1
    share the code what you are trying from application – spandey Jul 22 '20 at 06:38
  • I just calling the Shell script from the application with passing parameter like path of the shell script & the JobName ,and its being called . String[] cmd = { inputEletpath, jobName}; Process p = Runtime.getRuntime().exec(cmd); byte[] tmp = new byte[1024]; BufferedReader reader = new BufferedReader(new nputStreamReader(p.getInputStream())); String jobSchDetails; String jobStatusResult = ""; while ((jobSchDetails = reader.readLine()) != null) { addAuditTrailEntry("Script output: " + jobSchDetails);jobStatusResult = jobStatusResult+jobSchDetails; – Dip Jul 22 '20 at 07:09
  • Does this answer your question? [Runtime.getRuntime().exec(cmd) hanging](https://stackoverflow.com/questions/13008526/runtime-getruntime-execcmd-hanging) – sal Jul 23 '20 at 04:59

0 Answers0