Changeset 274 in MondoRescue for trunk/mondo/mondo/common


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

merge -r272:273 $SVN_M/branches/2.06

Location:
trunk/mondo/mondo/common
Files:
5 edited

Legend:

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

    r262 r274  
    10251025#else
    10261026    asprintf(&command,
    1027             "cat /proc/filesystems | grep -v nodev | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '");
     1027            "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '");
    10281028#endif
    10291029
  • trunk/mondo/mondo/common/libmondo-filelist.c

    r171 r274  
    530530  if (find_home_of_exe("setfacl"))
    531531    {
    532       sprintf(command, "cat %s | gzip -dc | setfacl --restore - 2>> %s", acl_fname, MONDO_LOGFILE);
     532      sprintf(command, "gzip -dc %s | setfacl --restore - 2>> %s", acl_fname, MONDO_LOGFILE);
    533533      log_msg(1, "command = %s", command);
    534534      retval = system(command);
     
    560560        log_msg(1,
    561561                "No masklist provided. I shall therefore set ALL attributes.");
    562         asprintf(&command, "cat %s | gzip -dc | %s --restore - 2>> %s",
     562        asprintf(&command, "gzip -dc %s | %s --restore - 2>> %s",
    563563                 original_exat_fname, executable, MONDO_LOGFILE);
    564564        log_msg(1, "command = %s", command);
     
    581581
    582582    sort_file(masklist);
    583     asprintf(&syscall_pin, "cat %s | gzip -dc", original_exat_fname);
     583    asprintf(&syscall_pin, "gzip -dc %s", original_exat_fname);
    584584    asprintf(&syscall_pout, "%s --restore - 2>> %s", executable,
    585585             MONDO_LOGFILE);
  • trunk/mondo/mondo/common/libmondo-raid.c

    r87 r274  
    4949    if (raidno == -1) {
    5050        asprintf(&command,
    51                  "cat /proc/mdstat | grep \"linear\" > /dev/null 2> /dev/null");
     51                 "grep \"linear\" /proc/mdstat > /dev/null 2> /dev/null");
    5252    } else {
    5353        asprintf(&command,
    54                  "cat /proc/mdstat | grep \"raid%d\" > /dev/null 2> /dev/null",
     54                 "grep \"raid%d\" /proc/mdstat > /dev/null 2> /dev/null",
    5555                 raidno);
    5656    }
  • trunk/mondo/mondo/common/libmondo-tools.c

    r197 r274  
    172172             "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \
    173173file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
    174 cat $file.old | awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
    175 else { print $0;};}' > $file ; fi ; done");
     174awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
     175else { print $0;};}'$file.old > $file ; fi ; done");
    176176    run_program_and_log_output(tmp, 5);
    177177    paranoid_free(tmp);
     
    870870#ifndef __FreeBSD__
    871871    if (run_program_and_log_output
    872         ("cat /proc/devices | grep ramdisk", FALSE)) {
     872        ("grep ramdisk /proc/devices", FALSE)) {
    873873        if (!ask_me_yes_or_no
    874874            ("Your kernel has no ramdisk support. That's mind-numbingly stupid but I'll allow it if you're planning to use a failsafe kernel. Are you?"))
     
    10961096    log_msg(4, "Done. Great. Seeting command to something");
    10971097    asprintf(&command,
    1098              "cat /etc/fstab | grep -v \":\" | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1098             "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    10991099    log_msg(4, "Cool. Command = '%s'", command);
    11001100    asprintf(&tmp, call_program_and_get_last_line_of_output(command));
  • trunk/mondo/mondo/common/libmondo-verify.c

    r171 r274  
    6363
    6464/*  sprintf (command,
    65        "cat %s | grep \"afio: \" | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort | uniq | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",
     65       "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",
    6666       stderr_fname, afio_found_changes);
    6767*/
     
    6969    log_msg(1, "Now scanning log file for 'afio: ' stuff");
    7070    asprintf(&command,
    71              "cat %s | grep \"afio: \" | sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s",
     71             "grep \"afio: \" %s | sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s",
    7272             stderr_fname, afio_found_changes);
    7373    log_msg(2, command);
     
    8080    log_msg(1, "Now scanning log file for 'star: ' stuff");
    8181    asprintf(&command,
    82              "cat %s | grep \"star: \" | sed 's/star: //' | grep -vx \"/dev/.*\" >> %s",
     82             "grep \"star: \" %s | sed 's/star: //' | grep -vx \"/dev/.*\" >> %s",
    8383             stderr_fname, afio_found_changes);
    8484    log_msg(2, command);
     
    9191    afio_diffs = count_lines_in_file(afio_found_changes);
    9292    asprintf(&command,
    93              "cat %s %s %s | sort | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s",
     93             "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s",
    9494             ignorefiles_fname, afio_found_changes, afio_found_changes,
    9595             changedfiles_fname);
     
    308308                    g_current_media_number, bigfile_num, slice_num);
    309309            if (bkpinfo->compression_level > 0) {
    310                 asprintf(&command, "cat %s | %s -dc 2>> %s",
     310                asprintf(&command, "%s -dc %s 2>> %s", sz_exe,
    311311                         slice_fname(bigfile_num, slice_num, mountpoint,
    312                                      bkpinfo->zip_suffix), sz_exe,
     312                                     bkpinfo->zip_suffix),
    313313                         MONDO_LOGFILE);
    314314            } else {
     
    448448        asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE);
    449449    } else {
    450         asprintf(&command, "cat %s | cut -d':' -f%d | sort | uniq", outlog,
    451                  (bkpinfo->use_star) ? 1 : 2);
     450        asprintf(&command, "cut -d':' -f%d %s | sort -u",
     451                 (bkpinfo->use_star) ? 1 : 2, outlog);
    452452        pin = popen(command, "r");
    453453        if (pin) {
     
    489489
    490490    /*  chdir(old_pwd); */
    491     //  sprintf (tmp, "cat %s | uniq -u >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);
     491    //  sprintf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);
    492492    //  paranoid_system (tmp);
    493493    //  unlink ("/tmp/mondo-verify.err");
     
    10841084             (int) (random() % 32767));
    10851085    asprintf(&tmp,
    1086              "cat %s | grep -x \"%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",
    1087              MONDO_LOGFILE, (bkpinfo->use_star) ? "star" : "afio",
     1086             "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",
     1087             (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    10881088             changed_files_fname);
    10891089    log_msg(2, "Running command to derive list of changed files");
Note: See TracChangeset for help on using the changeset viewer.