unix - newline character in POSIX shell -


I am parsing the output of the avahi-browse tool and my script should be POSIX compatible.

I am doing it the next way:

  local_dnssd = 'avahi-browse -apt` if [-z "$ _dnssd"]; Then echo "no information" in other IFS = '' # $ _dnssd new line character in IFS for local _tmpIFP = "$ IFS" IFS = ";" In the case of "$ _row" ... ASAC IFS = "$ _ TMPIFs"  

I do not like line with the new line for IFS. Is it possible to change it better?

I tried some suggestions from StackVerflow but it does not work:

  IFS = $ (echo -e '\ N')  < / Pre> 

avahi-browse output:

  + br0; IPv4; Switch4b66e4; _http._tcp; Local +; Br0; IPv4; Switch 4b 66 e4; _csco-sb._tcp; Local  

\ n in IFS variable, then delete the location again:

  IFS = "$ (printf '\ n')" & amp; Amp; IFS = "$ {IFS%}" #IFS = "$ (printf '\ n')" & amp; Amp; IFS = "$ {IFS%}}" printf '% s' "$ IFS" | | Odi-AnC  

Comments