HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl script help
Operating System - HP-UX
1835942
Members
2651
Online
110088
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
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
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
07-07-2003 05:32 PM
07-07-2003 05:32 PM
Dear all,
I am new to the perl and am trying to write a small script which calculates the disk usage by a directory. I tried to use the following command to get the size in KB in perl script.
$oraclin_data_sz=`du -sk $oraclin_data/$db_study_name|awk -F" " '{print $1}'` ;
Some how the above script return both size as well as the dir name. Could somebody help on how to strip the dir from the about command output. TIA
3 /opt/ORACLE/odc/dev/aps
Kris
I am new to the perl and am trying to write a small script which calculates the disk usage by a directory. I tried to use the following command to get the size in KB in perl script.
$oraclin_data_sz=`du -sk $oraclin_data/$db_study_name|awk -F" " '{print $1}'` ;
Some how the above script return both size as well as the dir name. Could somebody help on how to strip the dir from the about command output. TIA
3 /opt/ORACLE/odc/dev/aps
Kris
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2003 05:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2003 01:00 PM
07-11-2003 01:00 PM
Re: Perl script help
You don't even need awk.
$oraclin_data_sz = [split /\s+/, `du -ksx $oraclin_data/$db_study_name`]->[0];
$oraclin_data_sz = [split /\s+/, `du -ksx $oraclin_data/$db_study_name`]->[0];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2003 01:12 PM
07-11-2003 01:12 PM
Re: Perl script help
Hello!
Remove the option of field separetor in awk.
If that's all that your script do i don't think that you need to use perl for this.
You use to much of unix commands to do this.
All the separate the fields you can use split
from perl functions.
Caesar
Remove the option of field separetor in awk.
If that's all that your script do i don't think that you need to use perl for this.
You use to much of unix commands to do this.
All the separate the fields you can use split
from perl functions.
Caesar
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP