Click here to Skip to main content
15,888,239 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
58..62 | % { nslookup 192.168.1."$_"}

I'm confused as to what the two successive periods represent. I understand the pipe and nslookup command but not the rest.

Thanks.

What I have tried:

58..62 | % { nslookup 192.168.1."$_"}

I'm confused as to what the two successive periods represent. I understand the pipe and nslookup command but not the rest.

Thanks.
Posted
Updated 22-Feb-17 9:24am
Comments
Graeme_Grant 22-Feb-17 9:48am    
I don't program in Bash but it looks like a range to me...
Richard MacCutchan 22-Feb-17 10:13am    
What happens when you run it?
[no name] 22-Feb-17 10:51am    
Why are you writing code you don't understand?

So, that doesn't appear to be valid bash code, starting a line with "58..62" is invalid, as it's not a command or shortcut... but if it's pseudo-code I'd guess it's attempting to run nslookup on a range of IP addresses.

This gets you the same thing that your code appears to be attempting to do:
Bash
#!/bin/bash
for i in {58..62}; do nslookup 192.168.1.$i ; done
 
Share this answer
 
Quote:
58..62

A simple search in bash reference manual gives the answer.
Since we are not a free search service, you will to find the answer by yourself/
1) find Bash reference Manual
2) search ".."

Advice: If you want to avoid rude answers in future, do at least basic researches before asking questions here.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900