Question: I'm working on a question that is asked me to compute the numbers of ways to sum to a specific value in a set of numbers

```
def ways_to_sum(number, set:{int}) -> int:
    blah, blah

```

Calling

```
ways_to_sum(7,{2,3,5})

```

Would give me

```
2

```

As, first, `5+2`, and then, `2+2+3` sums to seven. The function must be recursive. I did not write the base case as I'm struggling to set it up.

Answer: 
I now think the problem is you don't actually have blank chars between your ports as shown in your question but instead have newlines or tabs. Given that, this will work no matter what the white space is:

```
$ nsg_port_a='22 80 443'
$ nsg_port_b='80 443'
$ [[ " $nsg_port_a $nsg_port_b " =~ [[:space:]]22[[:space:]] ]] && ssh=22
$ echo "$ssh"
22

```
I am considering that you want to check if port `22` is present in your both variables or not, if this is what you need then please try following. Make sure your shell variables `nsg_port_a` and `nsg_port_b` are set with values since they are being passed to `awk` program further.

```
awk -v nsg_port_a="$nsg_port_a" -v nsg_port_b="$nsg_port_b" '
BEGIN{
  num1=split(nsg_port_a,arr1," ")
  num2=split(nsg_port_b,arr2," ")
  for(i=1;i<=num1;i++){
    if(arr1[i]=="22"){ found=1 }
  }
  for(k=1;k<=num2;k++){
    if(arr2[k]=="22"){ found++ }
  }
  if(found==2){
    print "Port 22 found in both variables."
  }
  else{
    print "Port 22 NOT found in both variables."
  }
}'

```

Adding one liner form of solution as per OP's request(though its always recommended to use non-one liner form of solution):

`awk -v nsg_port_a="$nsg_port_a" -v nsg_port_b="$nsg_port_b" 'BEGIN{num1=split(nsg_port_a,arr1," ");num2=split(nsg_port_b,arr2," ");for(i=1;i<=num1;i++){if(arr1[i]=="22"){ found=1 }};for(k=1;k<=num2;k++){if(arr2[k]=="22"){ found++ }};if(found==2){print "Port 22 found in both variables."}else{print "Port 22 NOT found in both variables."}}'`