Skip to content

Instantly share code, notes, and snippets.

@gnosek
Last active October 28, 2016 20:00
Show Gist options
  • Save gnosek/eeb60962460cb0e3c921d3fbde23234c to your computer and use it in GitHub Desktop.
Save gnosek/eeb60962460cb0e3c921d3fbde23234c to your computer and use it in GitHub Desktop.
#!/bin/bash
LIST1=(foo bar baz quux)
LIST2=(aaa bbb ccc ddd)
LIST3=(eee fff ggg hhh)
for i in LIST{1..3}[@]
do
echo ${!i} | grep -q bbb && echo $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment