How to use the ping command in a script to get an IP address automatically and ping it.

This command will get the IP address from the interface supplied and then ping it. ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://)ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://) Here is an example. This shows how well this … Read more