1

Curl is working fine on the node itself:

[ec2-user@smokebase1 ~]$ curl -s -I --retry 3 --header 'Host: smoke-base.dev-test.com' localhost:8080/test/api/search?where=where%20%2Fxml%2Fitem%2Fcategory%20is%20not%20%27dog%25%27 | grep "HTTP/1.1 200 OK" | wc -l
1
[ec2-user@smokebase1 ~]$ exit
logout
Connection to 10.4.11.14 closed.

but not giving right result with ssh command although

[vsha@ip-10-4-11-25 ~]$  ssh ec2-user@10.4.11.14 'curl -s -I --retry 3 --header 'Host: smoke-base.dev-test.com' localhost:8080/test/search?where=where%20%2Fxml%2Fitem%2Fcategory%20is%20not%20%27dog%25%27 | grep "HTTP/1.1 200 OK" | wc -l'
0
Jenny D
  • 27,358
  • 21
  • 74
  • 110
A_01
  • 133
  • 1
  • 6
  • Did you try putting that inside a bash script and executing that instead? Also what do you mean by "wrong result" ? – phoops May 23 '14 at 07:32

1 Answers1

2

Your problem will almost certainly be to do with quoting. By trying to put ' around your whole ssh command line, they will match up with those already in your curl command and produce unexpected results.

You could try changing the ' for " in your curl command then wrap the whole ssh command in '

user9517
  • 114,104
  • 20
  • 206
  • 289