I have a file containing the string
ipAddress=10.78.90.137;10.78.90.149
I\'d like to place these two IP addresses in a bash array. To achie
You can do this by using IFS in bash.
= as delimeter.; as delimeter.Thats it !!!
#!/bin/bash
IFS='\n' read -r lstr < "a.txt"
IFS='=' read -r -a lstr_arr <<< $lstr
IFS=';' read -r -a ip_arr <<< ${lstr_arr[1]}
echo ${ip_arr[0]}
echo ${ip_arr[1]}