I have written a command that will search Credhub to find entries that match a certain condition and then delete those matching items. It works perfectly. Problem is that I want this command to not do anything if it doesn't find any matches.
Here is what I have
credhub find -n sachin | grep name: | cut -c9- | xargs -I {} credhub delete -n {}
How can I change this to do nothing if no matches are found?