macos – extract if_index without grep from scutil – dns

j & # 39; uses grep command to extract the active interfaces from the output of scutil order with --dns option.

scutil - dns | grep if #index & # 39;

I suspect that if in a user device using a different system language (Spanish, Chinese, etc.), the text "if_index" changes and the above command does not produce the correct result. Is my suspicion correct? If this is the case, could anyone tell what is the proper way to perform the above operation?