Changeset 680 in MondoRescue


Ignore:
Timestamp:
Jun 25, 2006, 3:56:38 AM (18 years ago)
Author:
andree
Message:

Replace occurrences of 'grep -v ... | grep -v ... | ...' with 'grep -Ev
...' for efficiency reasons and to ease trouble-shooting.

This also fixes Debian bug #222052.

Location:
branches/stable/mondo/mondo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/libmondo-devices.c

    r541 r680  
    25232523    strcpy(tmp,
    25242524           call_program_and_get_last_line_of_output
    2525            ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2525           ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    25262526#else
    25272527    strcpy(tmp,
    25282528           call_program_and_get_last_line_of_output
    2529            ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | grep -v /dev/shm | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2529           ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    25302530#endif
    25312531
  • branches/stable/mondo/mondo/common/libmondo-tools.c

    r679 r680  
    11301130    // abort if Windows partition but no ms-sys and parted
    11311131    if (!run_program_and_log_output
    1132         ("mount | grep -w vfat | grep -v /dev/fd | grep -v nexdisk", 0)
     1132        ("mount | grep -w vfat | grep -vE \"/dev/fd|nexdisk\"", 0)
    11331133        ||
    11341134        !run_program_and_log_output
    1135         ("mount | grep -w dos | grep -v /dev/fd | grep -v nexdisk", 0)) {
     1135        ("mount | grep -w dos | grep -vE \"/dev/fd|nexdisk\"", 0)) {
    11361136        log_to_screen("I think you have a Windows 9x partition.");
    11371137        retval += whine_if_not_found("parted");
  • branches/stable/mondo/mondo/restore-scripts/mondo/make-me-bootable

    r567 r680  
    1818
    1919HAVE_ACTIVE="false"
    20 for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -v "/dev/fd" | grep -v "none" | grep -v "#"` ; do
     20for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -vE "/dev/fd|none|#"` ; do
    2121    mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2`
    2222    format=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f3`
  • branches/stable/mondo/mondo/restore-scripts/mondo/mount-me

    r567 r680  
    1414fi
    1515
    16 paths=`grep -v " raid " $mountlist | grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
     16paths=`grep -vE " raid |lvm lvm" $mountlist | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
    1717> $mountlist.sorted
    1818for i in $paths ; do
Note: See TracChangeset for help on using the changeset viewer.