1 2 3 4 5 6
#!/bin/bash echo "clean chef nodes" yes | knife node bulk delete '.*' if [[ "$?" != "0" ]]; then echo "failed to clean all nodes" fi