This doesn’t give _identical_ output; IPv6 addresses are missing.

```bash
$ ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'
::1
127.0.0.1
fe80::1
fe80::5ab0:35ff:fe73:1337
192.168.51.248

$ ifconfig -a  | awk '/inet /{print $2}'
127.0.0.1
192.168.51.248
```