- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: extract data
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
Forums
Discussions
Discussions
Discussions
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
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
12-15-2003 07:02 PM
12-15-2003 07:02 PM
for example,
/dev/vg00/lvol5 614400 177916 411617 30% /home
for this case i hope to get 30 instead of 30%
Rgs
Cheng Wee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:11 PM
12-15-2003 07:11 PM
Re: extract data
Probably not the best way....but it works :
# size=$(# bdf | awk '/vg00\/lvol5/ {print $5}' | cut -d% -f1)
You would change the search pattern enclosed in the /.../ for a more general search.
Cheers,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:12 PM
12-15-2003 07:12 PM
Re: extract data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:21 PM
12-15-2003 07:21 PM
Re: extract data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:22 PM
12-15-2003 07:22 PM
Re: extract data
echo "/dev/vg00/lvol5 614400 177916 411617 30% /home" | awk -F "[\t %]+" '{print $5}'
or
echo "/dev/vg00/lvol5 614400 177916 411617 30% /home" | sed -e 's/^[^%]*[\t ]\([0-9]*\)%[^%]*$/\1/'
and many more :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:24 PM
12-15-2003 07:24 PM
Re: extract data
Thks for the solution, i exam all n all are working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:26 PM
12-15-2003 07:26 PM
Re: extract data
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:29 PM
12-15-2003 07:29 PM
Re: extract data
#!/usr/bin/perl
@FILESYSTEMS=(`bdf 2>/dev/null`);
while($filesystem=pop @FILESYSTEMS){
chop($filesystem);
next if $filesystem =~ /.*Filesystem.*/;
next if $filesystem =~ /swap.*/;
next if $filesystem =~ /proc.*/;
($waste,$waste2,$waste3,$waste4,$percentage,$fs)=split " ", $filesystem;
if($fs eq ""){ # A two line df filesystem output
$fs=$percentage;
$percentage=$waste4;
$filesystem=pop @FILESYSTEMS;
}
next if $filesystem =~ /:/; # Lose NFS filesystems
$percentage =~ /(.+)%/; # drop the % sign
print "$fs $percentage\n";
}