When we run knife search command, it is listing the number of items found. I don't want the number of items, instead i need only the results. How to get it. Example to say, I would like to get some return code or nil value for the below command.
$ knife search node "name:MyLinux AND role:java"
0 items found
You may use knife exec for this and use the
exitmethod of ruby.Example (even if it's try to undertand what you wish to accomplish with so few details/context):
Which will return 0 if nothing is found and 1 if any number of nodes are found.
If you wish to do something to the nodes (like adding a recipe to the run_list):