0

Running the follow echo $dnsDefinedUrl,$dnsResolvableHost,$dnsDefinedHost,1 returns:

,1d-ldn-uat.gb.derkb.com,ln2i32.zineta.com,[ln2i32.zineta.com]

You will note the 1 at the beginning of the output. But should be at the end of the output.

i expect return to be ,d-ldn-uat.gb.derkb.com,ln2i32.zineta.com,[ln2i32.zineta.com],1

Jay
  • 1
  • 1
  • 3
    `$dnsDefinedHost` obviously has a carriage return (`\r`) at the end. You could use `tr` to remove carriage returns. – Jerry Jeremiah Jul 22 '21 at 23:07
  • 2
    Use `dos2unix` to fix the file that you read these variables from. – Barmar Jul 22 '21 at 23:18
  • 1
    See ["Are shell scripts sensitive to encoding and line endings?"](https://stackoverflow.com/questions/39527571/are-shell-scripts-sensitive-to-encoding-and-line-endings) for more info and options for removing the carriage returns. – Gordon Davisson Jul 22 '21 at 23:30
  • Thank you guys. @Barmar dos2unix fixed it – Jay Jul 23 '21 at 05:32

1 Answers1

0
echo $dnsDefinedUrl,$dnsResolvableHost,$dnsDefinedHost,1 | sed 's/\r//g'
B.Ch.
  • 220
  • 1
  • 10