Changeset 274 for trunk


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

merge -r272:273 $SVN_M/branches/2.06

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/aux-tools/sbin/format-and-kludge-vfat

    r197 r274  
    110110umount /mnt/tmpK || Die "Can't unmount /mnt/tmpK"
    111111
    112 ideal_size=`cat /tmp/mountlist.txt | grep "$device " | tr -s ' ' ' ' | cut -d' ' -f4`
     112ideal_size=`grep "$device " /tmp/mountlist.txt | tr -s ' ' ' ' | cut -d' ' -f4`
    113113if [ "$ideal_size" = "" ]; then
    114114    LogIt "format-and-kludge-vfat --- can't find $device in mountlist" 1
  • trunk/mindi/mindi

    r262 r274  
    244244        included_list=`gzip -dc $mappath | fgrep -i include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
    245245    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`
    247247    fi
    248248    for included_item in $included_list ; do
     
    313313    if [ ! -f "$copy_from" ] ; then
    314314        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`
    316316        if [ ! -f "$copy_from" ] ; then
    317317            LogIt "Nor can I find it from your /etc/lilo.conf file. This is very odd.\n"
     
    505505    outdir=$2
    506506
    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`
    508508    if [ "$list_of_optimized_libraries" = "" ] ; then
    509509    return 0
     
    526526    ln -sf $vanilla_lib_name $outdir$optimized_lib_name
    527527    echo "Excluding $optimized_lib_name" >> $LOGFILE
    528     cat $filelist | fgrep -vx "$optimized_lib_name" > $filelist.tmp
     528    fgrep -vx "$optimized_lib_name $filelist" > $filelist.tmp
    529529    echo "Replacing it with $vanilla_lib_name" >> $LOGFILE
    530530    echo "$vanilla_lib_name" >> $filelist.tmp
    531531    mv -f $filelist.tmp $filelist
    532532    done
    533     cat $filelist | sort | $AWK '{ print $1; }' | uniq > $filelist.tmp
     533    sort $filelist | $AWK '{ print $1; }' | uniq > $filelist.tmp
    534534    mv -f $filelist.tmp $filelist
    535535    echo -e "$DONE"
     
    584584    fi
    585585    echo "keyfile=$keyfile" >> $LOGFILE
    586     locale=`cat "$keyfile" |fgrep KEYTABLE | tr -d '"' |cut -d'=' -f2`
    587     [ ! "$locale" ] && locale=`cat "$keyfile" | grep '.map$' | sed 's/^.* //'`      # Slackware
     586    locale=`fgrep KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
     587    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    588588    echo "locale=$locale" >> $LOGFILE
    589589    mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | fgrep "${locale}." | grep -vx " *#.*"`
     
    998998    local res currline partition all_partitions ap_orig remaining i j
    999999
    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}'
    10011001#    for partition in `$FDISK -l | tr -s ' ' '\n' | grep /dev` ; do
    10021002#        [ -e "$i" ] && all_partitions=echo "$i"
     
    14251425        echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
    14261426    elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    1427         if [ "`cat /etc/raidtab 2> /dev/null | fgrep device | fgrep $current_partition`" ] ; then
     1427        if [ "`fgrep device /etc/raidtab 2>/dev/null | fgrep $current_partition`" ] ; then
    14281428        partition_mountpt=raid
    14291429        partition_format=raid
     
    14711471    rmdir $1
    14721472    echo -en "  " > $1
    1473     if [ "`cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; 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` `cat /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.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/"`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.tmp
     1473    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
    14771477    fi
    14781478    cat $1.tmp | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ > $1
     
    16401640    local disksize
    16411641    disksize=$1
    1642     if [ "`cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; 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` `cat /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`/
    16461646    fi
    16471647    if [ "$disksize" -gt "2880" ] ; then
     
    19441944    fi
    19451945    if [ $? -ne "0" ] ; then
    1946     if [ "`cat $LOGFILE | fgrep "/tmp/dev.0"`" ] ; then
     1946    if [ "`fgrep "/tmp/dev.0" $LOGFILE`" ] ; then
    19471947        LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n"
    19481948        LogIt "Please reboot your PC as a workaround.\n"
     
    21032103    tardir=$TMP_ROOT/tardir
    21042104
    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`
    21062106    cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines
    21072107    res=$?
     
    28762876    lsmod | cut -d' ' -f1 >> $fname
    28772877    lsmod | cut -d' ' -f1 >> $fname
    2878     modules=`cat $fname | sort | uniq -d2 | tr '\n' ' '`
     2878    modules=`sort $fname | uniq -d2 | tr '\n' ' '`
    28792879    rm -f $fname
    28802880    [ "$modules" ] && echo "Unsaved kernel modules: $modules" >> $LOGFILE
     
    29502950    FindLiloBinary
    29512951fi
    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 reason
     2952fgrep " $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
    29532953rm -f /tmp/mindi_lo
    29542954trap "Aborted" SIGTERM
  • trunk/mindi/rootfs/sbin/find-and-mount-cdrom

    r30 r274  
    77    for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do
    88        [ ! "$SECOND_TRY" ] && LogIt "Trying $device"
    9         if [ "`cat /tmp/mondo-restore.cfg | grep "using-cdstream yes"`" ]; then
     9        if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ]; then
    1010        pwd=`pwd`
    1111        cd $GROOVY
     
    7777#mount /dev/fd0u1722 -t ext2 /mnt/floppy
    7878[ "$1" = "--second-try" ] && exit 1; # don't try to mount floppy drive
    79 if [ "`cat /tmp/mondo-restore.cfg | grep "using-cdstream yes"`" ] ; then
     79if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ] ; then
    8080    LogIt "Because you are using cdstream, I won't try to mount CD."
    8181    exit 0
  • trunk/mindi/rootfs/sbin/post-init

    r236 r274  
    5959cat /tmp/mountlist.txt >> /tmp/mondo-restore.log
    6060
    61 iso=`cat /proc/cmdline | grep "iso"`
    62 nuke=`cat /proc/cmdline | grep "nuke"`
     61iso=`grep iso /proc/cmdline`
     62nuke=`grep nuke /proc/cmdline`
    6363if [ "$nuke" = "" ] ; then
    64     nuke=`cat /proc/cmdline | grep -i "RESTORE "`
     64    nuke=`grep -i "RESTORE " /proc/cmdline`
    6565fi
    66 expert=`cat /proc/cmdline | grep "expert"`
    67 compare=`cat /proc/cmdline | grep "compare"`
    68 interactive=`cat /proc/cmdline | grep "interactive"`
     66expert=`grep expert /proc/cmdline`
     67compare=`grep compare /proc/cmdline`
     68interactive=`grep interactive /proc/cmdline`
    6969[ "$interactive" ]  && expert=""; # in case 'expert' crops up somewhere
    7070if which mondorestore > /dev/null 2> /dev/null ; then
     
    112112    mondorestore --nuke
    113113elif [ "$expert" ] ; then
    114     if [ "`cat /tmp/mondo-restore.cfg | grep tapedev`" ] ; then
     114    if [ "`grep tapedev /tmp/mondo-restore.cfg`" ] ; then
    115115    LogIt "-------------------TAPE MODE-------------------" 1
    116116    loc=`which mondorestore 2> /dev/null`
     
    125125            fi
    126126    fi
    127     elif [ "`cat /tmp/mondo-restore.cfg | grep using-cdstream`" ] ; then
     127    elif [ "`grep using-cdstream /tmp/mondo-restore.cfg`" ] ; then
    128128        LogIt "------------------CDSTREAM MODE------------------" 1
    129129        loc=`which mondorestore 2> /dev/null`
  • 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");
  • trunk/mondo/mondo/mondo-makefilelist

    r30 r274  
    9999    done
    100100# exclude lost+found folders, Win9x hibernation file and Win9x swap file
    101     cat $TMP/filelist | sort | uniq | \
     101    sort $TMP/filelist -u | \
    102102grep -v "/win386\.swp" | grep -v "/vmmhiber\.w9x" | \
    103103grep -v "/hiberfil\.sys" | grep -v "/win386.swp" | grep -v "/pagefile\.sys" | \
     
    108108# End patch
    109109#     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.MID
     110        grep -vx "$i/lost+found" $output | grep -vx $i"lost+found" > $output.MID
    111111        sync
    112112        mv -f $output.MID $output
     
    114114# exclude .journal files (ext3)
    115115    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.MID
     116    grep -vx "$i/\.journal" $output | grep -vx "$i\.journal" | grep -vx "$i\.autofsck" > $output.MID
    117117        sync
    118118    mv -f $output.MID $output
    119119    done
    120120# 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.MID
     121    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
    122122    mv -f $output.MID $output
    123123    cp -f $output $TMP/filelist
    124124# exclude /var/run/*.pid (lockfiles)
    125 #    cat $output | grep -vx "/var/run/[^\.]*\.pid" > $output.MID
     125#    grep -vx "/var/run/[^\.]*\.pid" $output > $output.MID
    126126#    mv -f $output.MID $output
    127127}
     
    180180for X in $EXCLUDE_PATHS  ; do
    181181    if [ ! -d $X ] ; then
    182     cat $TMP/filelist.blah | grep -v $X > $TMP/filelist.full
     182    grep -v $X $TMP/filelist.blah > $TMP/filelist.full
    183183    mv -f $TMP/filelist.full $TMP/filelist.blah
    184184    fi
    185185done
    186 cat $TMP/filelist.blah | grep -v "mojo-jojo-123" > $TMP/filelist.full
     186grep -v "mojo-jojo-123" $TMP/filelist.blah > $TMP/filelist.full
    187187[ ! -e "$TMP/filelist.full" ] && FatalError "Serious error when removing mojo jojo from fielist"
    188188cp $TMP/filelist.full /tmp
  • trunk/mondo/mondo/mondorestore/mondo-restore.c

    r252 r274  
    31013101    fatal_error("This will fail");
    31023102    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);
    31053105    if (system(command)) {
    31063106        retval++;
     
    31113111    fatal_error("This will fail");
    31123112    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);
    31153115    if (system(command)) {
    31163116        log_msg(1,
  • trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c

    r181 r274  
    553553    assert(raidrec != NULL);
    554554    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");
    556556    strcpy(personalities,
    557557           last_line_of_file("/tmp/raid-personalities.txt"));
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r254 r274  
    382382            f, file);
    383383    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);
    385385    res = run_program_and_log_output(command, FALSE);
    386386    paranoid_free(command);
     
    540540    }
    541541    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",
    543543            rclocal_fname);
    544544    if (system(tmp)) {
     
    551551\\n\
    552552\\n\
    553 cat %s | grep -v mondorescue > %s\\n\
     553grep -v mondorescue %s > %s\\n\
    554554rm -f /var/lock/subsys/*xfs*\\n\
    555555rm -f /var/run/xfs.*\\n\
     
    13531353            paranoid_system(command);
    13541354        }
    1355         sprintf(command, "cat %s | grep  -x \"/dev/.*\" > %s",
     1355        sprintf(command, "grep  -x \"/dev/.*\" %s > %s",
    13561356                g_biggielist_txt, g_filelist_imagedevs);
    13571357        paranoid_system(command);
  • trunk/mondo/mondo/post-nuke.sample/usr/bin/post-nuke

    r30 r274  
    3636    sz_add="$3"
    3737    > $newfile
    38     cat $oldfile | grep -v "$sz_exclude.*" >> $newfile
     38    grep -v "$sz_exclude.*" $oldfile >> $newfile
    3939    echo "$sz_add" >> $newfile
    4040}
  • trunk/mondo/mondo/restore-scripts/mondo/compare-me

    r30 r274  
    104104    padded_bfnum=`printf "%07d" $bf_num`
    105105    slice_fname=`GiveSliceName $bf_num $slice_num`
    106     checksum=`cat $slice_fname | cut -f1`
    107 #    finalsize=`cat $slice_fname | cut -f2`
    108     i=`cat $slice_fname | cut -f3`
     106    checksum=`cut -f1 $slice_fname`
     107#    finalsize=`cut -f2 $slice_fname`
     108    i=`cut -f3 $slice_fname`
    109109    outputfile=/mnt/RESTORING/"$i"
    110110    echo -n "$i "
     
    164164        outcome=$?
    165165            retval=$(($retval+$outcome))
    166         cat /tmp/rsm.log | grep -v "ignored" > /tmp/rsm.2.log
     166        grep -v ignored /tmp/rsm.log > /tmp/rsm.2.log
    167167        if [ "$outcome" -ne "0" ] ; then
    168168        echo -e -n "                                                                            \r"
     
    261261fi
    262262
    263 cat /tmp/compare-me.log \
    264 | grep -v -x "Files [^:]*:-" \
     263grep -v -x "Files [^:]*:-" /tmp/compare-me.log \
    265264| sort | uniq > /tmp/suspect.files
    266265
  • trunk/mondo/mondo/restore-scripts/mondo/grub-MR

    r197 r274  
    6464    BOOTPATHNAME=""
    6565    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`
    6767    [ "$bootpart" ] && [ -e "/mnt/RESTORING/$bootpart" ] && break
    6868    done
     
    164164if echo $bootpart | grep "/md" > /dev/null ; then
    165165    base=`basename $bootpart`
    166     line=`cat /proc/mdstat | grep $base | head -n1`
     166    line=`grep $base /proc/mdstat | head -n1`
    167167    echo "mbrpart was $mbrpart"
    168168    mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \
  • trunk/mondo/mondo/restore-scripts/mondo/hack-fstab

    r30 r274  
    3030    size=`echo "$incoming"       | cut -d' ' -f4`
    3131#    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 ' ' ' '`
    3333#    echo "original_fstab_line = $original_fstab_line" >> /dev/stderr
    34     if [ "`cat $old_fstab | grep "LABEL="`" != "" ] ; then
     34    if [ "`grep "LABEL=" $old_fstab`" != "" ] ; then
    3535    if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
    3636        device="LABEL=$mountpoint"
     
    8989    col2=`echo "$incoming" | cut -f2`
    9090    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`"
    9292    if [ "`echo "$orig" | grep "LABEL="`" != "" ] ; then
    9393    echo "orig = $orig" >> /dev/stderr
  • trunk/mondo/mondo/restore-scripts/mondo/hack-lilo

    r30 r274  
    5454    newdev=`GetNewFstabMountpoint $dev`
    5555    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`
    5858    newdev="$col1_new"
    5959    if [ ! "$newdev" ] ; then
     
    6161    fi
    6262    fi
    63 #    old_fstab_line=`cat $new_fstab | grep "$dev"`
     63#    old_fstab_line=`grep "$dev" $new_fstab`
    6464    [ "$2" = "other" ] || echo -e -n "\t"
    6565    echo -e "$2=$newdev"
     
    135135ProcessLilo < $old_lilo >> $outfile
    136136chmod 600 $outfile
    137 cat $bootlistfile | sort | uniq > $bootlistfile
     137sort -u $bootlistfile -o $bootlistfile
    138138
    139139#------ disabled 12/10/01 (doesn't do anything anyway *g*)
  • trunk/mondo/mondo/restore-scripts/mondo/label-partitions-as-necessary

    r30 r274  
    2828    mountline=`mount | grep " $label "`
    2929#   mountpt=`echo "$mountline" | cut -d' ' -f1`
    30 !   mountpt=`cat $mountlist | grep " $label " | cut -d' ' -f1`
     30!   mountpt=`grep " $label " $mountlist | cut -d' ' -f1`
    3131        if [ ! "$mountpt" ] ; then
    3232            LogIt "Not labeling anything as $label because $mountpt is not a mountpoint"
  • trunk/mondo/mondo/restore-scripts/mondo/make-me-bootable

    r197 r274  
    1919HAVE_ACTIVE="false"
    2020for 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`
    2323    drive=`echo $i | sed -e 's/[0-9]*$//' -e 's/\([0-9]\)p$/\1/'`
    2424    partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'`
  • trunk/mondo/mondo/restore-scripts/mondo/mount-me

    r30 r274  
    1414fi
    1515
    16 paths=`cat $mountlist | grep -v " raid " | grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
     16paths=`grep -v " raid " $mountlist | grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
    1717> $mountlist.sorted
    1818for i in $paths ; do
  • trunk/mondo/mondo/restore-scripts/mondo/restore-bigfiles-from-iso

    r30 r274  
    4141        echo -en "."
    4242        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`
    4545            OUTFNAME=`echo "$restorepath/$OUTFNAME" | tr -s '/' '/'`
    4646            echo "Now restoring $OUTFNAME"
  • trunk/mondo/mondo/restore-scripts/mondo/stablilo-me

    r30 r274  
    9191
    9292WhatIsFirstDriveCalled() {
    93     cat /tmp/mountlist.txt | cut -d' ' -f1 \
     93    cut -d' ' -f1 /tmp/mountlist.txt \
    9494| sed s/[0-9]// | sed s/[0-9]// \
    9595| sort | uniq | head -n 1
  • trunk/mondo/mondo/restore-scripts/mondo/unmount-me

    r30 r274  
    1717done
    1818
    19 for i in `cat /proc/swaps | cut -d' ' -f1 | grep /dev`; do
     19for i in `cut -d' ' -f1 /proc/swaps | grep /dev`; do
    2020    swapoff $i
    2121done
Note: See TracChangeset for help on using the changeset viewer.