Bash Script: Loop through an array of strings like foreach in PHP

Bash Script:

#!/bin/bash


IP1="1.2.3.1"
IP2="1.2.3.2"
IP3="1.2.3.3"


for i in $IP1 $IP2 $IP3
do
   echo "$i"
done

 

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare