in reply to Parsing command line input from STDIN
(or use -0777 if there are no impossible output characters). Golfers (sorry, I can't resist) might write:lvdisplay /dev/vg00/lvol3 | perl -ln0aF'\n' -e 'print for @F[1,4,5]'
Or select on line-number, e.g.:lvdisplay /dev/vg00/lvol3 | perl -lp0aF'\n' -e '}for(@F[1,4,5]){' lvdisplay /dev/vg00/lvol3 | perl -n0aF/^/m -e 'print@F[1,4,5]'
Golfers would of course write that as:lvdisplay /dev/vg00/lvol3 | perl -ne 'print if $.=~/^(2|5|6)$/'
(use a real control-H in the last one for a one char gain)lvdisplay /dev/vg00/lvol3 | perl -pe '$_ x=$.=~/^[256]/' lvdisplay /dev/vg00/lvol3 | perl -pe '$_ x=256=~$.' lvdisplay /dev/vg00/lvol3 | perl -pe '$_ x=$^H=~$.'
|
|---|