TStanley has asked for the wisdom of the Perl Monks concerning the following question:
The above is more info than I really need. What I would like to get this to look like is the following:$ lvdisplay /dev/vg00/lvol3 --- Logical volumes --- LV Name /dev/vg00/lvol3 VG Name /dev/vg00 LV Permission read/write LV Status available/syncd Mirror copies 1 Consistency Recovery MWC Schedule parallel LV Size (Mbytes) 200 Current LE 50 Allocated PE 100 Stripes 0 Stripe Size (Kbytes) 0 Bad block off Allocation strict/contiguous IO Timeout (Seconds) default
My attempt at this is to pipe the output of the lvdisplay into a perl command line program as follows:LV Name /dev/vg00/lvol3 LV Status available/syncd Mirror copies 1
Any ideas as to how I might accomplish this?lvdisplay /dev/vg00/lvol3 |perl -a -n -F'\n' -e'print "$F[1]\n$F[4]\n$ +F[5]\n";'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing command line input from STDIN
by broquaint (Abbot) on Dec 19, 2003 at 14:01 UTC | |
by TStanley (Canon) on Dec 19, 2003 at 14:08 UTC | |
|
Re: Parsing command line input from STDIN
by thospel (Hermit) on Dec 19, 2003 at 16:33 UTC | |
|
Re: Parsing command line input from STDIN
by gt8073a (Hermit) on Dec 19, 2003 at 22:17 UTC |