Save list of groups which user $line belongs to and not matching pattern "_unknown|sciences|everyone|netaccounts" in 'results' variable
results=$(groups "$line" | tr ' ' '\n' | egrep -v "_unknown|sciences|everyone|netaccounts")