0
echo "The tag in the last image heberged on the registry:"
var="docker images "localhost:5000/*" --format='{{.Tag}}' | head -1"

if [ "$var" == '2' ]
then
echo "its equal"
else
echo "its not equal"

eval "$var"

with ./script.sh i have my tag which is 2 but the function if doesn't work.

jabbson
  • 4,390
  • 1
  • 13
  • 23
Aymane
  • 1
  • Welcome to stackoverflow. It seems like your questions lacks a meaningful description. Please include such information as what you are trying to achieve, what are the actual and expected results. – jabbson Nov 12 '21 at 20:51
  • `$var` is equal to `docker image ...`, not `2`. See the duplicate for how to run a command and assign the output to a variable. – that other guy Nov 12 '21 at 21:24

0 Answers0