1 #!/bin/sh 2 3 for i 4 do 5 # This works whether sed uses \(\) or () for grouping. 6 echo $i | sed 's/.*\((.*)\).*/\1/' | tr -d '()' 7 done