15
rated 0 times
[
15]
[
0]
/ answers: 1 / hits: 1826
/ 11 Months ago, sat, may 27, 2023, 2:24:51
I want to extract the IP and Port from a variable. I have tried to use this:
ADDR=1.2.3.4:12345
IP=${ADDR##:}
PORT=${ADDR%:}
However, this assigns the entire address to both variables.
How can I store the the IP and Port to two variables?
More From » bash