I wrote a simple shell script to list get me some stuff and perform a grep based on pattern:
kubectl get virtualservice -A | grep '*' | while read -r line ; do
echo "$line"
done
The line output is:
whatsapp-business whatsapp-business-web ["istio-system/istio-ingressgw"] ["*"] 374d
I would like to get first and second parameters to pass in a command like:
kubectl get virtualservice -A | grep '*' | while read -r line ; do
echo "$line"
# kubectl delete virtualservice whatsapp-business-web -n whatsapp-business
# that line should be dynamic based on $line
done
Any idea how can I achieve this? Im kinda new to shell script.