1

I am using hostname -I to list all of the IP addresses for a host. I then processes this list under the assumption that it is space delimited. Is this assumption valid in general? I see that the man page says that you shouldn't make assumptions about order, but can I assume that

  • This command and option is available on all major distributions of linux
  • The output produced by this command is always space delimited

Thanks!

1 Answers1

2

No, you can't, at least not until you sufficiently limit "all major distributions of linux". Older versions don't have this option at all and e.g. the BSD/MacOS version is completely different.

Sven
  • 98,649
  • 14
  • 180
  • 226