Explorar el Código

Add slightly better 'awk' condition

Tianon Gravi hace 10 años
padre
commit
74476b9bbf
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      hello-world/update.sh

+ 1 - 1
hello-world/update.sh

@@ -13,7 +13,7 @@ echo
 	docker run --rm hello-world
 	docker run --rm hello-world
 	echo
 	echo
 	echo '$ docker images hello-world'
 	echo '$ docker images hello-world'
-	docker images hello-world | awk -F'  +' '$2 == "TAG" || $2 == "latest" { print $1"\t"$2"\t"$3"\t"$5 }' | column -t -s$'\t'
+	docker images hello-world | awk -F'  +' 'NR == 1 || $2 == "latest" { print $1"\t"$2"\t"$3"\t"$5 }' | column -t -s$'\t'
 } | sed 's/^/\t/'
 } | sed 's/^/\t/'
 
 
 echo
 echo