0
Talk people! How do I compare a multiline variable (2 lines) with a string and have to validate one line at a time the contents of the variable is:
ambient_1 ambient_2
code test you:
#!/bin/bash
#valor da variável vem de 1 arquivo que contém as duas linhas
ambientes=$(<ambiente)
if [ ${ambientes} == "ambiente" ]; then
echo "$ambientes"
else
echo "O valor é: $ambientes"
fi
Always error in the validation because it tries to compare with the 2 values at the same time, i need the script to compare first with 1 value and then the other understand that I will need to do some loop repetition but still do not know how to compare the value of each line separately. It is possible?
Thanks for the answer! But even with this script he keeps comparing the 2 values at the same time.
– Ricardo Santos