- Timestamp:
- Jan 3, 2006, 4:15:54 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/aux-tools/sbin/format-and-kludge-vfat
r197 r274 110 110 umount /mnt/tmpK || Die "Can't unmount /mnt/tmpK" 111 111 112 ideal_size=` cat /tmp/mountlist.txt | grep "$device "| tr -s ' ' ' ' | cut -d' ' -f4`112 ideal_size=`grep "$device " /tmp/mountlist.txt | tr -s ' ' ' ' | cut -d' ' -f4` 113 113 if [ "$ideal_size" = "" ]; then 114 114 LogIt "format-and-kludge-vfat --- can't find $device in mountlist" 1 -
trunk/mindi/mindi
r262 r274 244 244 included_list=`gzip -dc $mappath | fgrep -i include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` 245 245 else 246 included_list=` cat $mappath | fgrep -i include| sed s/'"'// | sed s/'"'// | cut -d' ' -f2`246 included_list=`fgrep -i include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` 247 247 fi 248 248 for included_item in $included_list ; do … … 313 313 if [ ! -f "$copy_from" ] ; then 314 314 LogIt "OK, you don't have a /boot/boot.b file, which is odd because\n most _good_ Linux distributions come with one, even if it's only a softlink" 315 copy_from=` cat /etc/lilo.conf | grep install=| grep "\.b" | cut -d'=' -f2`315 copy_from=`grep install= /etc/lilo.conf | grep "\.b" | cut -d'=' -f2` 316 316 if [ ! -f "$copy_from" ] ; then 317 317 LogIt "Nor can I find it from your /etc/lilo.conf file. This is very odd.\n" … … 505 505 outdir=$2 506 506 507 list_of_optimized_libraries=` cat $filelist | grep "lib/i[5-7]86/"`507 list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist` 508 508 if [ "$list_of_optimized_libraries" = "" ] ; then 509 509 return 0 … … 526 526 ln -sf $vanilla_lib_name $outdir$optimized_lib_name 527 527 echo "Excluding $optimized_lib_name" >> $LOGFILE 528 cat $filelist | fgrep -vx "$optimized_lib_name" > $filelist.tmp528 fgrep -vx "$optimized_lib_name $filelist" > $filelist.tmp 529 529 echo "Replacing it with $vanilla_lib_name" >> $LOGFILE 530 530 echo "$vanilla_lib_name" >> $filelist.tmp 531 531 mv -f $filelist.tmp $filelist 532 532 done 533 cat $filelist | sort | $AWK '{ print $1; }' | uniq > $filelist.tmp533 sort $filelist | $AWK '{ print $1; }' | uniq > $filelist.tmp 534 534 mv -f $filelist.tmp $filelist 535 535 echo -e "$DONE" … … 584 584 fi 585 585 echo "keyfile=$keyfile" >> $LOGFILE 586 locale=` cat "$keyfile" |fgrep KEYTABLE| tr -d '"' |cut -d'=' -f2`587 [ ! "$locale" ] && locale=` cat "$keyfile" | grep '.map$'| sed 's/^.* //'` # Slackware586 locale=`fgrep KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 587 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 588 588 echo "locale=$locale" >> $LOGFILE 589 589 mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | fgrep "${locale}." | grep -vx " *#.*"` … … 998 998 local res currline partition all_partitions ap_orig remaining i j 999 999 1000 cat $MY_FSTAB | grep -vx " *#.*"| grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||LABEL\=\// && !/fdd|cdr|zip|floppy/ {print $1}'1000 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||LABEL\=\// && !/fdd|cdr|zip|floppy/ {print $1}' 1001 1001 # for partition in `$FDISK -l | tr -s ' ' '\n' | grep /dev` ; do 1002 1002 # [ -e "$i" ] && all_partitions=echo "$i" … … 1425 1425 echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE 1426 1426 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1427 if [ "` cat /etc/raidtab 2> /dev/null | fgrep device| fgrep $current_partition`" ] ; then1427 if [ "`fgrep device /etc/raidtab 2>/dev/null | fgrep $current_partition`" ] ; then 1428 1428 partition_mountpt=raid 1429 1429 partition_format=raid … … 1471 1471 rmdir $1 1472 1472 echo -en " " > $1 1473 if [ "` cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; then1474 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `c at /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp1475 else 1476 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"` cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel"| head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp1473 if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then 1474 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp 1475 else 1476 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp 1477 1477 fi 1478 1478 cat $1.tmp | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ > $1 … … 1640 1640 local disksize 1641 1641 disksize=$1 1642 if [ "` cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; then1643 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `c at /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/1644 else 1645 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"` cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel"| head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/1642 if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then 1643 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ 1644 else 1645 cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/ 1646 1646 fi 1647 1647 if [ "$disksize" -gt "2880" ] ; then … … 1944 1944 fi 1945 1945 if [ $? -ne "0" ] ; then 1946 if [ "` cat $LOGFILE | fgrep "/tmp/dev.0"`" ] ; then1946 if [ "`fgrep "/tmp/dev.0" $LOGFILE`" ] ; then 1947 1947 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n" 1948 1948 LogIt "Please reboot your PC as a workaround.\n" … … 2103 2103 tardir=$TMP_ROOT/tardir 2104 2104 2105 lines=` cat $MINDI_CONF/deplist.txt | grep -vx " *#.*" | grep -vx "" |wc -l`2105 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l` 2106 2106 cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines 2107 2107 res=$? … … 2876 2876 lsmod | cut -d' ' -f1 >> $fname 2877 2877 lsmod | cut -d' ' -f1 >> $fname 2878 modules=` cat $fname | sort| uniq -d2 | tr '\n' ' '`2878 modules=`sort $fname | uniq -d2 | tr '\n' ' '` 2879 2879 rm -f $fname 2880 2880 [ "$modules" ] && echo "Unsaved kernel modules: $modules" >> $LOGFILE … … 2950 2950 FindLiloBinary 2951 2951 fi 2952 cat /proc/mounts | fgrep " $TMP_ROOT "| fgrep tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason2952 fgrep " $TMP_ROOT " /proc/mounts | fgrep tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason 2953 2953 rm -f /tmp/mindi_lo 2954 2954 trap "Aborted" SIGTERM -
trunk/mindi/rootfs/sbin/find-and-mount-cdrom
r30 r274 7 7 for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do 8 8 [ ! "$SECOND_TRY" ] && LogIt "Trying $device" 9 if [ "` cat /tmp/mondo-restore.cfg | grep "using-cdstream yes"`" ]; then9 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ]; then 10 10 pwd=`pwd` 11 11 cd $GROOVY … … 77 77 #mount /dev/fd0u1722 -t ext2 /mnt/floppy 78 78 [ "$1" = "--second-try" ] && exit 1; # don't try to mount floppy drive 79 if [ "` cat /tmp/mondo-restore.cfg | grep "using-cdstream yes"`" ] ; then79 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ] ; then 80 80 LogIt "Because you are using cdstream, I won't try to mount CD." 81 81 exit 0 -
trunk/mindi/rootfs/sbin/post-init
r236 r274 59 59 cat /tmp/mountlist.txt >> /tmp/mondo-restore.log 60 60 61 iso=` cat /proc/cmdline | grep "iso"`62 nuke=` cat /proc/cmdline | grep "nuke"`61 iso=`grep iso /proc/cmdline` 62 nuke=`grep nuke /proc/cmdline` 63 63 if [ "$nuke" = "" ] ; then 64 nuke=` cat /proc/cmdline | grep -i "RESTORE "`64 nuke=`grep -i "RESTORE " /proc/cmdline` 65 65 fi 66 expert=` cat /proc/cmdline | grep "expert"`67 compare=` cat /proc/cmdline | grep "compare"`68 interactive=` cat /proc/cmdline | grep "interactive"`66 expert=`grep expert /proc/cmdline` 67 compare=`grep compare /proc/cmdline` 68 interactive=`grep interactive /proc/cmdline` 69 69 [ "$interactive" ] && expert=""; # in case 'expert' crops up somewhere 70 70 if which mondorestore > /dev/null 2> /dev/null ; then … … 112 112 mondorestore --nuke 113 113 elif [ "$expert" ] ; then 114 if [ "` cat /tmp/mondo-restore.cfg | grep tapedev`" ] ; then114 if [ "`grep tapedev /tmp/mondo-restore.cfg`" ] ; then 115 115 LogIt "-------------------TAPE MODE-------------------" 1 116 116 loc=`which mondorestore 2> /dev/null` … … 125 125 fi 126 126 fi 127 elif [ "` cat /tmp/mondo-restore.cfg | grep using-cdstream`" ] ; then127 elif [ "`grep using-cdstream /tmp/mondo-restore.cfg`" ] ; then 128 128 LogIt "------------------CDSTREAM MODE------------------" 1 129 129 loc=`which mondorestore 2> /dev/null` -
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"); -
trunk/mondo/mondo/mondo-makefilelist
r30 r274 99 99 done 100 100 # exclude lost+found folders, Win9x hibernation file and Win9x swap file 101 cat $TMP/filelist | sort | uniq| \101 sort $TMP/filelist -u | \ 102 102 grep -v "/win386\.swp" | grep -v "/vmmhiber\.w9x" | \ 103 103 grep -v "/hiberfil\.sys" | grep -v "/win386.swp" | grep -v "/pagefile\.sys" | \ … … 108 108 # End patch 109 109 # for i in `cat /etc/fstab | tr -s '\t' ' ' | cut -d' ' -f2` ; do 110 cat $output | grep -vx "$i/lost+found"| grep -vx $i"lost+found" > $output.MID110 grep -vx "$i/lost+found" $output | grep -vx $i"lost+found" > $output.MID 111 111 sync 112 112 mv -f $output.MID $output … … 114 114 # exclude .journal files (ext3) 115 115 for i in `cat /etc/fstab | tr -s '\t' ' ' | grep "ext3" | cut -d' ' -f2` ; do 116 cat $output | grep -vx "$i/\.journal"| grep -vx "$i\.journal" | grep -vx "$i\.autofsck" > $output.MID116 grep -vx "$i/\.journal" $output | grep -vx "$i\.journal" | grep -vx "$i\.autofsck" > $output.MID 117 117 sync 118 118 mv -f $output.MID $output 119 119 done 120 120 # exclude /var/log/pacct and Mondo's temp files 121 cat $output | grep -vx ""| grep -v "/var/log/pacct" | grep -v "tmp\.mondo\.$$" | grep -vx "/var/log/mondo-archive\.log" | grep -v "mondo\.scratch\.$$" > $output.MID121 grep -vx "" $output | grep -v "/var/log/pacct" | grep -v "tmp\.mondo\.$$" | grep -vx "/var/log/mondo-archive\.log" | grep -v "mondo\.scratch\.$$" > $output.MID 122 122 mv -f $output.MID $output 123 123 cp -f $output $TMP/filelist 124 124 # exclude /var/run/*.pid (lockfiles) 125 # cat $output | grep -vx "/var/run/[^\.]*\.pid"> $output.MID125 # grep -vx "/var/run/[^\.]*\.pid" $output > $output.MID 126 126 # mv -f $output.MID $output 127 127 } … … 180 180 for X in $EXCLUDE_PATHS ; do 181 181 if [ ! -d $X ] ; then 182 cat $TMP/filelist.blah | grep -v $X> $TMP/filelist.full182 grep -v $X $TMP/filelist.blah > $TMP/filelist.full 183 183 mv -f $TMP/filelist.full $TMP/filelist.blah 184 184 fi 185 185 done 186 cat $TMP/filelist.blah | grep -v "mojo-jojo-123"> $TMP/filelist.full186 grep -v "mojo-jojo-123" $TMP/filelist.blah > $TMP/filelist.full 187 187 [ ! -e "$TMP/filelist.full" ] && FatalError "Serious error when removing mojo jojo from fielist" 188 188 cp $TMP/filelist.full /tmp -
trunk/mondo/mondo/mondorestore/mondo-restore.c
r252 r274 3101 3101 fatal_error("This will fail"); 3102 3102 sprintf(command, 3103 " cat %s | grep -x \"%s.*\"> %s",3104 g_filelist_full, restore_this_directory, g_filelist_full);3103 "grep -x \"%s.*\" %s > %s", 3104 restore_this_directory, g_filelist_full, g_filelist_full); 3105 3105 if (system(command)) { 3106 3106 retval++; … … 3111 3111 fatal_error("This will fail"); 3112 3112 sprintf(command, 3113 " cat %s | grep -x \"%s.*\"> %s",3114 g_biggielist_txt, restore_this_directory, g_biggielist_txt);3113 "grep -x \"%s.*\" %s > %s", 3114 restore_this_directory, g_biggielist_txt, g_biggielist_txt); 3115 3115 if (system(command)) { 3116 3116 log_msg(1, -
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
r181 r274 553 553 assert(raidrec != NULL); 554 554 system 555 (" cat /proc/mdstat | grep Pers> /tmp/raid-personalities.txt 2> /dev/null");555 ("grep Pers /proc/mdstat > /tmp/raid-personalities.txt 2> /dev/null"); 556 556 strcpy(personalities, 557 557 last_line_of_file("/tmp/raid-personalities.txt")); -
trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c
r254 r274 382 382 f, file); 383 383 log_msg(2, tmp); 384 sprintf(command, " cat %s | grep -x \"%s\"", list_fname, file);384 sprintf(command, "grep -x \"%s\" %s", file, list_fname); 385 385 res = run_program_and_log_output(command, FALSE); 386 386 paranoid_free(command); … … 540 540 } 541 541 sprintf(newfile_fname, "%s/rc.local.mondorescue", path); 542 sprintf(tmp, " cat %s | grep mondorescue> /dev/null 2> /dev/null",542 sprintf(tmp, "grep mondorescue %s > /dev/null 2> /dev/null", 543 543 rclocal_fname); 544 544 if (system(tmp)) { … … 551 551 \\n\ 552 552 \\n\ 553 cat %s | grep -v mondorescue> %s\\n\553 grep -v mondorescue %s > %s\\n\ 554 554 rm -f /var/lock/subsys/*xfs*\\n\ 555 555 rm -f /var/run/xfs.*\\n\ … … 1353 1353 paranoid_system(command); 1354 1354 } 1355 sprintf(command, " cat %s | grep -x \"/dev/.*\"> %s",1355 sprintf(command, "grep -x \"/dev/.*\" %s > %s", 1356 1356 g_biggielist_txt, g_filelist_imagedevs); 1357 1357 paranoid_system(command); -
trunk/mondo/mondo/post-nuke.sample/usr/bin/post-nuke
r30 r274 36 36 sz_add="$3" 37 37 > $newfile 38 cat $oldfile | grep -v "$sz_exclude.*">> $newfile38 grep -v "$sz_exclude.*" $oldfile >> $newfile 39 39 echo "$sz_add" >> $newfile 40 40 } -
trunk/mondo/mondo/restore-scripts/mondo/compare-me
r30 r274 104 104 padded_bfnum=`printf "%07d" $bf_num` 105 105 slice_fname=`GiveSliceName $bf_num $slice_num` 106 checksum=`c at $slice_fname | cut -f1`107 # finalsize=`c at $slice_fname | cut -f2`108 i=`c at $slice_fname | cut -f3`106 checksum=`cut -f1 $slice_fname` 107 # finalsize=`cut -f2 $slice_fname` 108 i=`cut -f3 $slice_fname` 109 109 outputfile=/mnt/RESTORING/"$i" 110 110 echo -n "$i " … … 164 164 outcome=$? 165 165 retval=$(($retval+$outcome)) 166 cat /tmp/rsm.log | grep -v "ignored"> /tmp/rsm.2.log166 grep -v ignored /tmp/rsm.log > /tmp/rsm.2.log 167 167 if [ "$outcome" -ne "0" ] ; then 168 168 echo -e -n " \r" … … 261 261 fi 262 262 263 cat /tmp/compare-me.log \ 264 | grep -v -x "Files [^:]*:-" \ 263 grep -v -x "Files [^:]*:-" /tmp/compare-me.log \ 265 264 | sort | uniq > /tmp/suspect.files 266 265 -
trunk/mondo/mondo/restore-scripts/mondo/grub-MR
r197 r274 64 64 BOOTPATHNAME="" 65 65 for sz in /boot / ; do 66 bootpart=` cat $2 | grep " $sz "| cut -d' ' -f1 | head -n1`66 bootpart=`grep " $sz " $2 | cut -d' ' -f1 | head -n1` 67 67 [ "$bootpart" ] && [ -e "/mnt/RESTORING/$bootpart" ] && break 68 68 done … … 164 164 if echo $bootpart | grep "/md" > /dev/null ; then 165 165 base=`basename $bootpart` 166 line=` cat /proc/mdstat | grep $base| head -n1`166 line=`grep $base /proc/mdstat | head -n1` 167 167 echo "mbrpart was $mbrpart" 168 168 mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \ -
trunk/mondo/mondo/restore-scripts/mondo/hack-fstab
r30 r274 30 30 size=`echo "$incoming" | cut -d' ' -f4` 31 31 # 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 ' ' ' '` 33 33 # echo "original_fstab_line = $original_fstab_line" >> /dev/stderr 34 if [ "` cat $old_fstab | grep "LABEL="`" != "" ] ; then34 if [ "`grep "LABEL=" $old_fstab`" != "" ] ; then 35 35 if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then 36 36 device="LABEL=$mountpoint" … … 89 89 col2=`echo "$incoming" | cut -f2` 90 90 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`" 92 92 if [ "`echo "$orig" | grep "LABEL="`" != "" ] ; then 93 93 echo "orig = $orig" >> /dev/stderr -
trunk/mondo/mondo/restore-scripts/mondo/hack-lilo
r30 r274 54 54 newdev=`GetNewFstabMountpoint $dev` 55 55 if [ ! "$newdev" ] ; then 56 col2=` cat $old_mountlist | grep "$dev "| cut -d' ' -f2`57 col1_new=` cat $new_mountlist | grep " $col2 "| cut -d' ' -f1`56 col2=`grep "$dev " $old_mountlist | cut -d' ' -f2` 57 col1_new=`grep " $col2 " $new_mountlist | cut -d' ' -f1` 58 58 newdev="$col1_new" 59 59 if [ ! "$newdev" ] ; then … … 61 61 fi 62 62 fi 63 # old_fstab_line=` cat $new_fstab | grep "$dev"`63 # old_fstab_line=`grep "$dev" $new_fstab` 64 64 [ "$2" = "other" ] || echo -e -n "\t" 65 65 echo -e "$2=$newdev" … … 135 135 ProcessLilo < $old_lilo >> $outfile 136 136 chmod 600 $outfile 137 cat $bootlistfile | sort | uniq >$bootlistfile137 sort -u $bootlistfile -o $bootlistfile 138 138 139 139 #------ disabled 12/10/01 (doesn't do anything anyway *g*) -
trunk/mondo/mondo/restore-scripts/mondo/label-partitions-as-necessary
r30 r274 28 28 mountline=`mount | grep " $label "` 29 29 # mountpt=`echo "$mountline" | cut -d' ' -f1` 30 ! mountpt=` cat $mountlist | grep " $label "| cut -d' ' -f1`30 ! mountpt=`grep " $label " $mountlist | cut -d' ' -f1` 31 31 if [ ! "$mountpt" ] ; then 32 32 LogIt "Not labeling anything as $label because $mountpt is not a mountpoint" -
trunk/mondo/mondo/restore-scripts/mondo/make-me-bootable
r197 r274 19 19 HAVE_ACTIVE="false" 20 20 for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -v "/dev/fd" | grep -v "none" | grep -v "#"` ; do 21 mountpt=` cat $1 | grep "$i "| tr -s '\t' ' ' | cut -d' ' -f2`22 format=` cat $1 | grep "$i "| tr -s '\t' ' ' | cut -d' ' -f3`21 mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2` 22 format=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f3` 23 23 drive=`echo $i | sed -e 's/[0-9]*$//' -e 's/\([0-9]\)p$/\1/'` 24 24 partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'` -
trunk/mondo/mondo/restore-scripts/mondo/mount-me
r30 r274 14 14 fi 15 15 16 paths=` cat $mountlist | grep -v " raid "| grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort`16 paths=`grep -v " raid " $mountlist | grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort` 17 17 > $mountlist.sorted 18 18 for i in $paths ; do -
trunk/mondo/mondo/restore-scripts/mondo/restore-bigfiles-from-iso
r30 r274 41 41 echo -en "." 42 42 if echo "$slicename" | grep "slice-[0-9]*.00000\.dat" 2> /dev/null; then 43 CHECKSUM=` cat $slicename | head -n1| cut -f1`44 OUTFNAME=` cat $slicename | head -n1| cut -f2`43 CHECKSUM=`head -n1 $slicename | cut -f1` 44 OUTFNAME=`head -n1 $slicename | cut -f2` 45 45 OUTFNAME=`echo "$restorepath/$OUTFNAME" | tr -s '/' '/'` 46 46 echo "Now restoring $OUTFNAME" -
trunk/mondo/mondo/restore-scripts/mondo/stablilo-me
r30 r274 91 91 92 92 WhatIsFirstDriveCalled() { 93 c at /tmp/mountlist.txt | cut -d' ' -f1\93 cut -d' ' -f1 /tmp/mountlist.txt \ 94 94 | sed s/[0-9]// | sed s/[0-9]// \ 95 95 | sort | uniq | head -n 1 -
trunk/mondo/mondo/restore-scripts/mondo/unmount-me
r30 r274 17 17 done 18 18 19 for i in `c at /proc/swaps | cut -d' ' -f1| grep /dev`; do19 for i in `cut -d' ' -f1 /proc/swaps | grep /dev`; do 20 20 swapoff $i 21 21 done
Note:
See TracChangeset
for help on using the changeset viewer.