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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -