select unique values from duplicates in linux

I have values in the variable as so the for loop just fetches one by one

params=$'$HEW_SRC_DATABASE_LIB\nprmAttunityUser\nprmAttunityPwd\nprmODBCDataSource\nprmLoadInd\nprmSrc_Lib_ATM\nprmODBCDataSource_ATM'

and i have a grep command like this

          ret=`grep \$y $pf` 
          

Where $y refers to values in the params variable and $pf contains certain values which are assigned to the values fetched from params variable.

The output through that command is

     $HEW_SRC_DATABASE_LIB prmAttunityUser prmAttunityPwd prmODBCDataSource prmODBCDataSource_ATM prmLoadInd prmSrc_Lib_ATM prmODBCDataSource_ATM
          

Due to which it returns me prmODBCDataSource as well as prmODBCDataSource_ATM whereas i want it to fetch it the same sequence as only

          $HEW_SRC_DATABASE_LIB prmAttunityUser prmAttunityPwd prmODBCDataSource prmLoadInd prmSrc_Lib_ATM prmODBCDataSource_ATM
          

I used grep command with ^ sign something like this

          ret=`grep \^prmAttunityUser\= filename`
          

But this skips some other values so both commands are not helping me.

Can anyone please help me with a proper grep command