- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how can i get major and minor number (perl, shell ...
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
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
тАО08-31-2011 01:06 AM
тАО08-31-2011 01:06 AM
how can i get with standard modules the "major nr" of unix group file ?
at Modul "File::stat" i didn't find anything:
i only found following modul :
http://search.cpan.org/~pirzyk/Unix-Mknod-0.04/lib...
but in my perl env it doesn't exist :
i want of example file /dev/volumegr/group following outputs :
ll /dev/volumegr/group
crw-r--r-- 1 root sys 64 0x040000 Oct 8 2007 /dev/volumegr/group
major: 0x040000 , minor: 64
or the other way with shell script is to parse "ll -d /dev/volumegr/group" ?
regards
Solved! Go to Solution.
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 01:39 AM - edited тАО08-31-2011 02:52 AM
тАО08-31-2011 01:39 AM - edited тАО08-31-2011 02:52 AM
Re: how can I get major and minor number (perl, shell script)
tusc shows that ll(1) is just calling lstat(2).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 02:31 AM
тАО08-31-2011 02:31 AM
Re: how can i get major and minor number (perl, shell script)
hello,
@ tusc shows that ll(1) is just calling lstat(2).
i search now for "lstat" and i found "lstat" use field nr. 6
i tried with a little script , but no success
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 05:02 AM
тАО08-31-2011 05:02 AM
Re: how can I get major and minor number (perl, shell script)
hello,
i got it :
printf " File major is %d ,\n minor is 0x%06.6x\n", ($dev >> 24) & 0xff, $rdev & 0xffffff;
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 05:34 AM
тАО08-31-2011 05:34 AM
Re: how can I get major and minor number (perl, shell script)
Hi:
While you seem to have found a solution, remember, CPAN is your friend. To guarantee portability, you could fetch and install 'File::Stat::Bits':
http://search.cpan.org/~fedorov/File-Stat-Bits-1.01/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 06:27 AM
тАО08-31-2011 06:27 AM
Re: how can I get major and minor number (perl, shell script)
hello,
what do yo recommend ?
my solution or
http://search.cpan.org/~fedorov/File-Stat-Bits-1.01/
?
a little question : with what "key" to you search at CPAN ? with "major nr" you get nothing and only "major" you get to much information ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2011 06:32 AM
тАО08-31-2011 06:32 AM
Re: how can I get major and minor number (perl, shell script)
@support_billa wrote:what do yo recommend ?
my solution or
http://search.cpan.org/~fedorov/File-Stat-Bits-1.01/?
a little question : with what "key" to you search at CPAN ? with "major nr" you get nothing and only "major" you get to much information ...
For portability, I would use the Perl module.
As for how I found the module, the stat() system call is the key, so I searched for modules with "stat".
Regards!
...JRF...