- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- any suggestion to increment in hex in a for loop ?
Operating System - HP-UX
1823920
Members
3088
Online
109667
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО06-01-2005 01:46 PM
тАО06-01-2005 01:46 PM
looking for a quick suggestion to increament in HEX ( instead of decimal) in a for loop to create large number of VGs ( appx 188)
Basically, I want to use minor number(YY) for the VG02 to VG95 (XX) in the following command :
mknod /dev/vgXX/group c 64 0xYY0000
XX should increment in decimal, start at 02
YY should increment in HEX, start at 02
TIA
-Q
Basically, I want to use minor number(YY) for the VG02 to VG95 (XX) in the following command :
mknod /dev/vgXX/group c 64 0xYY0000
XX should increment in decimal, start at 02
YY should increment in HEX, start at 02
TIA
-Q
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 02:51 PM
тАО06-01-2005 02:51 PM
Solution
You can leverage the printf command to do this for you.
---------------------------------------
#!/usr/bin/sh
typeset -i I=2
typeset -i STOP=95
while [[ ${I} -le ${STOP} ]]
do
typeset DEC=$(printf "%02d" ${I})
typeset HEX=$(printf "%02x" ${I})
echo "DEC: ${DEC} HEX: ${HEX}"
# mkdir /dev/vg${DEC} -p -m 750
# mknod /dev/vg${DEC}/group c 64 0x${HEX}0000
((I += 1))
done
----------------------------------------
Uncomment the mkdir and mknod lines when you are confident.
---------------------------------------
#!/usr/bin/sh
typeset -i I=2
typeset -i STOP=95
while [[ ${I} -le ${STOP} ]]
do
typeset DEC=$(printf "%02d" ${I})
typeset HEX=$(printf "%02x" ${I})
echo "DEC: ${DEC} HEX: ${HEX}"
# mkdir /dev/vg${DEC} -p -m 750
# mknod /dev/vg${DEC}/group c 64 0x${HEX}0000
((I += 1))
done
----------------------------------------
Uncomment the mkdir and mknod lines when you are confident.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 05:54 AM
тАО06-02-2005 05:54 AM
Re: any suggestion to increment in hex in a for loop ?
Worked like a champ ! Thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 05:58 AM
тАО06-02-2005 05:58 AM
Re: any suggestion to increment in hex in a for loop ?
Solved the problem, so closing it :)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP