Claim your Biolink Click Here
3 like 0 dislike
111 views
I have a file with conf extension with the below content

[ {agent, "xyz://BC:[email protected]"}
[ {agent, "xyz://BC:[email protected]"}  % content

And I need to extract the IP 10.0.0.1
in Education & Reference by (730 points) | 111 views

1 Answer

1 like 0 dislike
Best answer
grep 'xyz://BC:' /pathtofile/*.conf | cut -d'@' -f2 | cut -d'"' -f1|head -1
by (3.6k points)
0 0
Explanation:
Syntax:
cut OPTION... [FILE]...
-d, --delimiter=DELIM   # use DELIM instead of TAB for field delimiter
-f, --fields=LIST       # select only these fields;  also print any line that.
> head: to see the file from top and 1 means first line

Related questions

0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,268 questions
1,423 answers
568 comments
4,809 users