bash - How to get second value of second column in output -


i have output this:

name              cluster_ip     external_ip   port(s)    selector                  age docker-registry   172.30.131.5   <none>        5000/tcp   docker-registry=default   33m 

now want ip. nothing else. used awk got cluster_ip too

result=$(oc svc/docker-registry | awk '{print $2}') 

just select 2nd line:

result=$(oc svc/docker-registry | awk 'nr==2{print $2}') 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -