#!/bin/bash
s="optimization and architecture
optimization and policy
optimization and network
optimization and awk
no words"
awk '/optimization/ && /architecture|policy|network/' <<< "$s"
IyEvYmluL2Jhc2gKcz0ib3B0aW1pemF0aW9uIGFuZCBhcmNoaXRlY3R1cmUgCm9wdGltaXphdGlvbiBhbmQgcG9saWN5IApvcHRpbWl6YXRpb24gYW5kIG5ldHdvcmsKb3B0aW1pemF0aW9uIGFuZCBhd2sKbm8gd29yZHMiCmF3ayAnL29wdGltaXphdGlvbi8gJiYgL2FyY2hpdGVjdHVyZXxwb2xpY3l8bmV0d29yay8nIDw8PCAiJHMi