- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: how to increment a number
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2007 06:49 AM
тАО07-20-2007 06:49 AM
SolutionJust change the -le 150 to the last IP number i used 150 as example, and change xx.xx as well.
hou00us:~> i=0; while [ $i -le 150 ]; do printf "10.xx.xx.%d\n" $i ;i=`expr $i + 1`; done
10.xx.xx.0
10.xx.xx.1
10.xx.xx.2
10.xx.xx.3
10.xx.xx.4
10.xx.xx.5
10.xx.xx.6
10.xx.xx.7
10.xx.xx.8
10.xx.xx.9
10.xx.xx.10
<<
10.xx.xx.150
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2007 10:19 AM
тАО07-20-2007 10:19 AM
Re: how to increment a number
command|while read a
do
((c=c+$a))
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2007 01:38 PM
тАО07-21-2007 01:38 PM
Re: how to increment a number
If you use bash shell you can use a for loop
very similar to C language syntax
for ((i=1; i<=100; i++))
do
echo $i
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 05:18 PM
тАО07-22-2007 05:18 PM
Re: how to increment a number
below an example of the nmap output:
=========================================
# nmap -sP 1.2.3.0/24
Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2007-07-23 09:14 MUT
Host 1.2.3.0 seems to be a subnet broadcast address (returned 10 extra pings). Note -- the actual IP also responded.
MAC Address: 00:0E:38:6F:FB:00 (Cisco Systems)
Host 1.2.3.1 appears to be up.
MAC Address: 00:03:6B:A7:0A:60 (Cisco Systems)
Host 1.2.3.2 appears to be up.
MAC Address: 00:17:E0:7E:98:96 (Unknown)
Host 1.2.3.3 appears to be up.
MAC Address: 00:0F:F7:16:1F:1E (Cisco Systems)
Host 1.2.3.4 appears to be up.
MAC Address: 00:0F:F7:16:1F:22 (Cisco Systems)
Host 1.2.3.5 appears to be up.
MAC Address: 00:11:85:F9:49:7A (Unknown)
Host 1.2.3.6 appears to be up.
MAC Address: 00:0E:38:50:97:80 (Cisco Systems)
Host 1.2.3.7 appears to be up.
MAC Address: 00:12:79:CF:55:ED (Unknown)
Host 1.2.3.8 appears to be up.
MAC Address: 00:12:79:CF:56:9F (Unknown)
Host 1.2.3.9 appears to be up.
MAC Address: 00:12:79:CF:55:ED (Unknown)
...
Host 1.2.3.251 appears to be up.
MAC Address: 00:16:17:5D:07:31 (Unknown)
Host 1.2.3.252 appears to be up.
MAC Address: 00:16:17:5C:EA:5C (Unknown)
Host 1.2.3.253 appears to be up.
MAC Address: 00:0C:29:74:2E:79 (VMware)
Host 1.2.3.254 appears to be up.
MAC Address: 00:0E:38:6F:FB:00 (Cisco Systems)
Host 1.2.3.255 seems to be a subnet broadcast address (returned 13 extra pings). Note -- the actual IP also responded.
MAC Address: 00:0E:38:6F:FB:00 (Cisco Systems)
Nmap run completed -- 256 IP addresses (167 hosts up) scanned in 6.706 seconds
=========================================
See if this is acceptable else we will have to work it out using scripts!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 10:49 PM
тАО07-22-2007 10:49 PM
Re: how to increment a number
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 10:52 PM
тАО07-22-2007 10:52 PM
Re: how to increment a number
- « Previous
-
- 1
- 2
- Next »