Created
March 16, 2018 23:12
-
-
Save raviprakashgiri/8e46929d847a2c7e3f8be02077b20acc to your computer and use it in GitHub Desktop.
A command to extract ip addresses along with port numbers from a file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filename contains: | |
#=============================================================================== | |
#==== **** || **** Orchestration and Automation | |
#=============================================================================== | |
#==== User :: **** | |
#==== Deployment id :: **** | |
#==== **** Instance (running) :: Container Name something1803162156077 | |
#==== :: **** http://10.242.65.215:38072 (default: solar/system) | |
#==== :: **** https://10.242.65.215:38070 | |
#=============================================================================== | |
arr="$(grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\:[0-9]\{3,10\}' filename)" | |
ip=(`echo ${arr}`) | |
echo ${arr[0]} | |
# Output | |
# 10.242.65.215:38072 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment