Remove newline characters from the output of a command that filters out lines beginning with # from the /etc/services file and sorts the remaining lines randomly, then prints the first line.
tr -d '\n' <(grep -v "^#" /etc/services | sort -R | head -n 1)