![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Moving the root partition (simple fstab / grub question) | d11wtq | UNIX for Dummies Questions & Answers | 7 | 10-07-2008 12:55 PM |
| How to edit /etc/fstab when root was mounted as read only | ilan | Linux | 3 | 02-28-2008 10:51 PM |
| /etc/mnttab is zero length - I have done a silly thing | Smiling Dragon | UNIX for Advanced & Expert Users | 7 | 12-09-2007 04:03 PM |
| /etc/fstab | byblyk | Linux | 6 | 07-07-2004 12:51 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
A wrapper is just a script that you call instead of the actual command (bdf) in your case. The script will modify your output as you wish, by internally calling stuff like sort/awk/whatever. Once you get the script in place, do not run bdf directly, but the always the script instead.
|
|
|||||
|
It occurred to me that a non-general solution is very easy. All you need is a control file with line numbers. You paste the control file on to the output from bdf, sort, then cut away the line numbers. I am not on an HP-UX system, so to demo this, first I need an ersatz bdf command.
Code:
$ export PATH=$PATH:. $ cat bdf #! /usr/bin/sed 1d Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol3 524288 211800 310104 41% / /dev/vg00/lvol1 1048576 792464 254216 76% /stand /dev/vg00/lvol7 4194304 2111048 2066992 51% /var /dev/vg00/lvol6 5275648 4324952 943312 82% /usr /dev/vg00/lvolu3 30736384 3901997 25157825 13% /u03 /dev/vg00/lvolu2 27033600 21665312 5034033 81% /u02 /dev/vg00/lvolu1 20480000 16962500 3298935 84% /u01 /dev/vg00/lvol5 229376 103248 125280 45% /tmp /dev/vg00/lvol4 4620288 3775088 838648 82% /opt /dev/vg00/lvol8 1048576 141744 899856 14% /home /dev/vg00/lvolu4 5144576 2148221 2809135 43% /u04 $ $ $ $ cat control 01 02 03 04 05 11 10 09 06 07 08 12 $ $ $ $ bdf Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol3 524288 211800 310104 41% / /dev/vg00/lvol1 1048576 792464 254216 76% /stand /dev/vg00/lvol7 4194304 2111048 2066992 51% /var /dev/vg00/lvol6 5275648 4324952 943312 82% /usr /dev/vg00/lvolu3 30736384 3901997 25157825 13% /u03 /dev/vg00/lvolu2 27033600 21665312 5034033 81% /u02 /dev/vg00/lvolu1 20480000 16962500 3298935 84% /u01 /dev/vg00/lvol5 229376 103248 125280 45% /tmp /dev/vg00/lvol4 4620288 3775088 838648 82% /opt /dev/vg00/lvol8 1048576 141744 899856 14% /home /dev/vg00/lvolu4 5144576 2148221 2809135 43% /u04 $ $ $ $ bdf | paste control - | sort -n | cut -f2 Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol3 524288 211800 310104 41% / /dev/vg00/lvol1 1048576 792464 254216 76% /stand /dev/vg00/lvol7 4194304 2111048 2066992 51% /var /dev/vg00/lvol6 5275648 4324952 943312 82% /usr /dev/vg00/lvol5 229376 103248 125280 45% /tmp /dev/vg00/lvol4 4620288 3775088 838648 82% /opt /dev/vg00/lvol8 1048576 141744 899856 14% /home /dev/vg00/lvolu1 20480000 16962500 3298935 84% /u01 /dev/vg00/lvolu2 27033600 21665312 5034033 81% /u02 /dev/vg00/lvolu3 30736384 3901997 25157825 13% /u03 /dev/vg00/lvolu4 5144576 2148221 2809135 43% /u04 $ |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|