Changeset 911 in MondoRescue for branches/stable/mondo


Ignore:
Timestamp:
Nov 1, 2006, 7:46:51 PM (17 years ago)
Author:
Bruno Cornec
Message:
Further removal of all instances of grep -wx in code.
Location:
branches/stable/mondo/src
Files:
5 edited

Legend:

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

    r908 r911  
    736736    strcpy(scratchdir, bkpinfo->scratchdir);
    737737    sprintf(tmp,
    738             "echo '%s' | tr -s ' ' '\n' | grep -x '/dev/.*' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
     738            "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
    739739            bkpinfo->exclude_paths);
    740740    strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp));
     
    38843884*/
    38853885        sprintf(tmp,
    3886                 "grep 'afio: ' %s | sed 's/afio: //' | grep -vx '/dev/.*' >> /tmp/changed.files",
     3886                "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    38873887                MONDO_LOGFILE);
    38883888        system(tmp);
    38893889
    38903890        sprintf(tmp,
    3891                 "grep 'star: ' %s | sed 's/star: //' | grep -vx '/dev/.*' >> /tmp/changed.files",
     3891                "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    38923892                MONDO_LOGFILE);
    38933893        system(tmp);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r909 r911  
    625625    strcpy(tmp,
    626626           call_program_and_get_last_line_of_output
    627            ("free | grep \":\" | tr -s ' ' '\t' | cut -f2 | head -n1"));
     627           ("free | grep ':' | tr -s ' ' '\t' | cut -f2 | head -n1"));
    628628    avm += atol(tmp);
    629629    sprintf(command, "mount /dev/shm -t tmpfs %s -o size=%d%c",
     
    13961396    log_msg(4, "Done. Great. Seeting command to something");
    13971397    strcpy(command,
    1398            "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1398           "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    13991399    log_msg(4, "Cool. Command = '%s'", command);
    14001400    strcpy(tmp, call_program_and_get_last_line_of_output(command));
     
    14101410            }
    14111411        } else {
    1412             sprintf(command, "mount | grep -E \"^%s\"", tmp);
     1412            sprintf(command, "mount | grep -E '^%s'", tmp);
    14131413            log_msg(3, "command = %s", command);
    14141414            if (run_program_and_log_output(command, 5)) {
     
    14861486           ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
    14871487    if (does_file_exist(config_file)) {
    1488         sprintf(command, "grep -vx '%s .*' %s > %s",
     1488        sprintf(command, "grep -vE '^%s .*$' %s > %s",
    14891489                label, config_file, tempfile);
    14901490        paranoid_system(command);
  • branches/stable/mondo/src/common/libmondo-verify.c

    r543 r911  
    165165    log_msg(1, "Now scanning log file for 'afio: ' stuff");
    166166    sprintf(command,
    167             "grep \"afio: \" %s | sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s",
     167            "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
    168168            stderr_fname, afio_found_changes);
    169169    log_msg(2, command);
     
    175175    log_msg(1, "Now scanning log file for 'star: ' stuff");
    176176    sprintf(command,
    177             "grep \"star: \" %s | sed 's/star: //' | grep -vx \"/dev/.*\" >> %s",
     177            "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    178178            stderr_fname, afio_found_changes);
    179179    log_msg(2, command);
     
    11491149            (int) (random() % 32767));
    11501150    sprintf(tmp,
    1151             "grep -x \"%s:.*\" %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"dev/.*\"  > %s",
     1151            "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$'  > %s",
    11521152            (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    11531153            changed_files_fname);
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r818 r911  
    31063106    fatal_error("This will fail");
    31073107    sprintf(command,
    3108             "grep -x \"%s.*\" %s > %s",
     3108            "grep -E '^%s.*$' %s > %s",
    31093109            restore_this_directory, g_filelist_full, g_filelist_full);
    31103110    if (system(command)) {
     
    31163116    fatal_error("This will fail");
    31173117    sprintf(command,
    3118             "grep -x \"%s.*\" %s > %s",
     3118            "grep -E '^%s.*$' %s > %s",
    31193119            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
    31203120    if (system(command)) {
  • branches/stable/mondo/src/restore-scripts/mondo/make-me-bootable

    r680 r911  
    4242    partno=$root_part
    4343else
    44     driveline=`grep -w /boot $1`
    45     [ ! "$driveline" ] && driveline=`grep -w / $1`
     44    driveline=`grep -E '[   ]/boot[     ]' $1`
     45    [ ! "$driveline" ] && driveline=`grep -E '[     ]/[     ]' $1`
    4646    partno=`echo "$driveline" | cut -d' ' -f1 | awk -F "[a-z]" '{print $NF;}'`
    4747#    echo "driveline=$driveline --> partno=$partno"
Note: See TracChangeset for help on using the changeset viewer.