I'm using bashrc
to make and delete snapshots.
To delete them, I wanna use that command:
ec2-describe-snapshots | sort -r -k 5 | awk '{print "Deleting snapshot: " $2}'
and using a grep on the description but when I use grep directly on that command like:
ec2-describe-snapshots | sort -r -k 5 | grep "My Keyword" | awk '{print "Deleting snapshot: " $2}; system("ec2-delete-snapshot " $2)'
It doesn't return anything because it search only on the id of the snapshot, isn't it?
So my question is: How can I search for a keyword that is included in the description on the snapshot?