I have a scenario where I am creating a new variable that will have only the `servces` values from a list of values available in `filex`.

```
$ cat filex

all_name1_db
all_name2_dm
alm_service1_ax
all_name3_du
alz_name4_dx
ali_name5_dk
alk_service2_av
alf_name6_df
alj_name7_dq

```

Here is the code that I use to create a variable `services` which will have only the values that has services in it.

```
for x in $filex
do
 if [[ $x == *"service1"* ]] || [[ $x == *"service2"* ]];then
   Services+=$x","
 fi
done

```

My end result will be a comma delimited value shown below.

```
$ cat $Services

alm_service1_ax,alk_service2_av

```

The problem now is, the `service` value is keep on increasing in `filex` and I can't extend my `if` statement by adding `||`. For instance, if I have a new service say `bum_service3_bk` included in `filex` then my `if` statement would look like this..

```
...
 if [[ $x == *"service1"* ]] || [[ $x == *"service2"* ]] || [[ $x == *"service3"* ]] ;then
...

```

and this will keep on increasing for every new `service` added in `filex`

Is there a way to write an `if` statement to have a single condition that can accommodate multiple or conditions or any better way to tackle my issue?