Changeset 274 in MondoRescue for trunk/mondo/mondo/common
- Timestamp:
- Jan 3, 2006, 4:15:54 PM (18 years ago)
- Location:
- trunk/mondo/mondo/common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-devices.c
r262 r274 1025 1025 #else 1026 1026 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' ' '"); 1028 1028 #endif 1029 1029 -
trunk/mondo/mondo/common/libmondo-filelist.c
r171 r274 530 530 if (find_home_of_exe("setfacl")) 531 531 { 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); 533 533 log_msg(1, "command = %s", command); 534 534 retval = system(command); … … 560 560 log_msg(1, 561 561 "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", 563 563 original_exat_fname, executable, MONDO_LOGFILE); 564 564 log_msg(1, "command = %s", command); … … 581 581 582 582 sort_file(masklist); 583 asprintf(&syscall_pin, " cat %s | gzip -dc", original_exat_fname);583 asprintf(&syscall_pin, "gzip -dc %s", original_exat_fname); 584 584 asprintf(&syscall_pout, "%s --restore - 2>> %s", executable, 585 585 MONDO_LOGFILE); -
trunk/mondo/mondo/common/libmondo-raid.c
r87 r274 49 49 if (raidno == -1) { 50 50 asprintf(&command, 51 " cat /proc/mdstat | grep \"linear\"> /dev/null 2> /dev/null");51 "grep \"linear\" /proc/mdstat > /dev/null 2> /dev/null"); 52 52 } else { 53 53 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", 55 55 raidno); 56 56 } -
trunk/mondo/mondo/common/libmondo-tools.c
r197 r274 172 172 "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \ 173 173 file=$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");174 awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \ 175 else { print $0;};}'$file.old > $file ; fi ; done"); 176 176 run_program_and_log_output(tmp, 5); 177 177 paranoid_free(tmp); … … 870 870 #ifndef __FreeBSD__ 871 871 if (run_program_and_log_output 872 (" cat /proc/devices | grep ramdisk", FALSE)) {872 ("grep ramdisk /proc/devices", FALSE)) { 873 873 if (!ask_me_yes_or_no 874 874 ("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?")) … … 1096 1096 log_msg(4, "Done. Great. Seeting command to something"); 1097 1097 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"); 1099 1099 log_msg(4, "Cool. Command = '%s'", command); 1100 1100 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); -
trunk/mondo/mondo/common/libmondo-verify.c
r171 r274 63 63 64 64 /* 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", 66 66 stderr_fname, afio_found_changes); 67 67 */ … … 69 69 log_msg(1, "Now scanning log file for 'afio: ' stuff"); 70 70 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", 72 72 stderr_fname, afio_found_changes); 73 73 log_msg(2, command); … … 80 80 log_msg(1, "Now scanning log file for 'star: ' stuff"); 81 81 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", 83 83 stderr_fname, afio_found_changes); 84 84 log_msg(2, command); … … 91 91 afio_diffs = count_lines_in_file(afio_found_changes); 92 92 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", 94 94 ignorefiles_fname, afio_found_changes, afio_found_changes, 95 95 changedfiles_fname); … … 308 308 g_current_media_number, bigfile_num, slice_num); 309 309 if (bkpinfo->compression_level > 0) { 310 asprintf(&command, " cat %s | %s -dc 2>> %s",310 asprintf(&command, "%s -dc %s 2>> %s", sz_exe, 311 311 slice_fname(bigfile_num, slice_num, mountpoint, 312 bkpinfo->zip_suffix), sz_exe,312 bkpinfo->zip_suffix), 313 313 MONDO_LOGFILE); 314 314 } else { … … 448 448 asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE); 449 449 } else { 450 asprintf(&command, "c at %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); 452 452 pin = popen(command, "r"); 453 453 if (pin) { … … 489 489 490 490 /* 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); 492 492 // paranoid_system (tmp); 493 493 // unlink ("/tmp/mondo-verify.err"); … … 1084 1084 (int) (random() % 32767)); 1085 1085 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, 1088 1088 changed_files_fname); 1089 1089 log_msg(2, "Running command to derive list of changed files");
Note:
See TracChangeset
for help on using the changeset viewer.