refactor and add tests for different OS output. Add handler for ip(1)