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

Patches from Sébastien Aperghis-Tramoni <maddingue@…>

replace several occurences of "cat .. | grep .."
or with similar commands that accept filenames as arguments.
+ some sort | uniq replaced by sort -u

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.06/mondo/mondo/restore-scripts/mondo/hack-fstab

    r30 r273  
    3030    size=`echo "$incoming"       | cut -d' ' -f4`
    3131#    echo "'$device' '$mountpoint' '$format' '$size'" > /dev/stderr
    32     original_fstab_line=`cat $old_fstab | grep " $mountpoint " | grep -v "#" | tr -s ' ' ' '`
     32    original_fstab_line=`grep " $mountpoint " $old_fstab | grep -v "#" | tr -s ' ' ' '`
    3333#    echo "original_fstab_line = $original_fstab_line" >> /dev/stderr
    34     if [ "`cat $old_fstab | grep "LABEL="`" != "" ] ; then
     34    if [ "`grep "LABEL=" $old_fstab`" != "" ] ; then
    3535    if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
    3636        device="LABEL=$mountpoint"
     
    8989    col2=`echo "$incoming" | cut -f2`
    9090    col_rest=`echo "$incoming" | cut -f3-19 | tr -s ' ' ' '`
    91     orig="`cat $old_fstab | grep " $col2 " | cut -f1`"
     91    orig="`grep " $col2 " $old_fstab | cut -f1`"
    9292    if [ "`echo "$orig" | grep "LABEL="`" != "" ] ; then
    9393    echo "orig = $orig" >> /dev/stderr
Note: See TracChangeset for help on using the changeset viewer.