There are at least 3 things wrong with your snippet.
Try:
IPS=(( 89.17.206.180 89.17.206.185 89.17.206.186 89.17.206.187 ))
for k in ${i...@]}
do
nmap -p 22 $k
done
jon.
On 07/07/2009, at 4:55 AM, tirengarfio wrote:
IPS={89.17.206.180,89.17.206.185,89.17.206.186,89.17.206.187}
tirengarfio wrote:
> IPS={89.17.206.180,89.17.206.185,89.17.206.186,89.17.206.187}
Check the value that you assigned using echo.
$ echo "$IPS"
{89.17.206.180,89.17.206.185,89.17.206.186,89.17.206.187}
Notice that brace expansion hasn't occurred in variable assignment.
In the bash manual it
Hi,
im trying to write a script to check the port 22 of 4 IPs.
IPS={89.17.206.180,89.17.206.185,89.17.206.186,89.17.206.187}
for i in ${IPS}
do
nmap -p 22 {IPS}
done
but i get this error:
Failed to resolve given hostname/IP: {IPS}. Note that you can't use '/mask'
AND '1-4,7,100-' style IP r