bash - Shell script - Giving error while iterating through array -
I'm trying to check if condition on a name value in the defined array. I'm experiencing this error: This is my code: change
main.sh: line 9: [10.247.78.207: command not found main.sh: line 9: [10.247.78.207: command not found < / code>
#! / Bin / bash declared - a name = $ {name :-( 10.247.78.207 10.247.78.206}} for ((I = 0; i <$ name # {@}}; i ++)) "[$ {Name {0}}" == "10.247.78.207"] Then echo "hello" files
["$ {names [0]}" == "10.247.78.207"] to
["$ {name [0]}" = = "10.247.78.207"] . This is the place after
[ and before
] . Hope this solves your problem.
Comments
Post a Comment