Changeset 275 in MondoRescue for branches/2.06/mindi/analyze-my-lvm


Ignore:
Timestamp:
Jan 3, 2006, 4:59:29 PM (18 years ago)
Author:
bcornec
Message:

more cat commands removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.06/mindi/analyze-my-lvm

    r97 r275  
    11#!/bin/sh
    2 
     2#
     3# $Id$
     4#
    35
    46#------------------------- ANALYZE-MY-LVM ----------------------- Hugo Rabson
     
    4244GetValueFromField() {
    4345    local res
    44     cat "$1" | sed s/'    '/~/ | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}'
     46    sed s/'    '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}'
    4547}
    4648
     
    244246# -------------------------------- main -----------------------------------
    245247which lvmdiskscan 2>/dev/null 2>&1 || Die "Cannot find lvmdiskscan. Are you sure you're using LVM?"
    246 if [ -e "/proc/lvm/global" ] && [ "`cat /proc/lvm/global | tr -s '\t' ' ' | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then
     248if [ -e "/proc/lvm/global" ] && [ "`tr -s '\t' ' ' < /proc/lvm/global | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then
    247249    exit 0
    248250fi
Note: See TracChangeset for help on using the changeset viewer.