Changeset 275 in MondoRescue for branches/2.06/mondo


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

more cat commands removed

Location:
branches/2.06/mondo/mondo
Files:
7 edited

Legend:

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

    r273 r275  
    24342434    strcpy(exclude_these_devices,
    24352435           call_program_and_get_last_line_of_output
    2436            ("cat /etc/fstab | tr -s '\t' ' ' | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2436           ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    24372437    sprintf(result_sz, "%s %s", exclude_these_directories,
    24382438            exclude_these_devices);
     
    24642464    strcpy(exclude_these_devices,
    24652465           call_program_and_get_last_line_of_output
    2466            ("cat /etc/fstab | tr -s '\t' ' ' | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2466           ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    24672467    sprintf(result_sz, "%s", exclude_these_directories);
    24682468    paranoid_free(exclude_these_devices);
  • branches/2.06/mondo/mondo/common/libmondo-filelist.c

    r273 r275  
    616616//      sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary
    617617        sprintf(command,
    618                 "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s",
     618                "getfacl --all-effective -P %s 2>> %s | gzip -c1 > %s 2>> %s",
    619619                filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE);
    620620        iamhere(command);
  • branches/2.06/mondo/mondo/common/libmondo-tools.c

    r273 r275  
    336336file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
    337337awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
    338 else { print $0;};}'$file.old  > $file ; fi ; done");
     338else { print $0;};}' $file.old  > $file ; fi ; done");
    339339    run_program_and_log_output(tmp, 5);
    340340    paranoid_free(tmp);
  • branches/2.06/mondo/mondo/mondo-makefilelist

    r273 r275  
    11#!/bin/sh
     2#
     3# $Id$
     4
    25#
    36# mondo-makefilelist
     
    8285    res=`grep -v "Permission denied" $TMP/find.log`
    8386    if [ "$res" != "" ] ; then
    84     cat $TMP/find.log
    85     cat $TMP/find.log >> $LOGFILE
     87    cat $TMP/find.log | tee -a $LOGFILE
    8688    fi
    8789# include various directory _paths_ (not contents of dirs: that comes later)
     
    105107
    106108# Patch from Andy Glass - 03/03/2002
    107     for i in `cat /etc/fstab | tr -s '\t' ' ' | cut -d' ' -f2 | grep -v '-'` ; do
     109    for i in `tr -s '\t' ' ' < /etc/fstab | cut -d' ' -f2 | grep -v '-'` ; do
    108110# End patch
    109 #     for i in `cat /etc/fstab | tr -s '\t' ' ' | cut -d' ' -f2` ; do
    110111        grep -vx "$i/lost+found" $output | grep -vx $i"lost+found" > $output.MID
    111112        sync
     
    113114    done
    114115# exclude .journal files (ext3)
    115     for i in `cat /etc/fstab | tr -s '\t' ' ' | grep "ext3" | cut -d' ' -f2` ; do
     116    for i in `tr -s '\t' ' ' < /etc/fstab | grep "ext3" | cut -d' ' -f2` ; do
    116117    grep -vx "$i/\.journal" $output | grep -vx "$i\.journal" | grep -vx "$i\.autofsck" > $output.MID
    117118        sync
  • branches/2.06/mondo/mondo/mondorestore/mondo-rstr-compare.c

    r128 r275  
    376376    if (length_of_file(logfile) > 5) {
    377377        sprintf(command,
    378                 "cat %s | sed s/': \\\"'/\\|/ | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort | uniq | grep -vx \"dev/.*\" >> /tmp/changed.txt",
     378                "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort | uniq | grep -vx \"dev/.*\" >> /tmp/changed.txt",
    379379                logfile);
    380380        system(command);
  • branches/2.06/mondo/mondo/restore-scripts/mondo/hack-lilo

    r273 r275  
    1515GetOldFstabMountpoint() {
    1616    local res
    17     res=`cat $old_fstab | tr -s '\t' ' ' | grep "$1" | cut -d' ' -f2`
     17    res=`tr -s '\t' ' ' < $old_fstab | grep "$1" | cut -d' ' -f2`
    1818#    echo "old_fstab = $old_fstab" >> /dev/stderr
    1919    if [ "$res" = "" ] ; then
    2020#   echo "OK, resB" >> /dev/stderr
    21     res=`cat $old_mountlist | tr -s '\t' ' ' | grep " $1 " | cut -d' ' -f1`
     21    res=`tr -s '\t' ' ' < $old_mountlist | grep " $1 " | cut -d' ' -f1`
    2222    fi
    2323    echo "$res"
     
    3434    old_mountpoint=`GetOldFstabMountpoint $1`
    3535#    echo "old_mountpoint = $old_mountpoint" >> /dev/stderr
    36     new_mountpoint=`cat $new_mountlist | tr -s '\t' ' ' | grep " $old_mountpoint" | cut -d' ' -f1`
     36    new_mountpoint=`tr -s '\t' ' ' < $new_mountlist | grep " $old_mountpoint" | cut -d' ' -f1`
    3737    if [ "$new_mountpoint" = "" ] ; then
    38     mtpt=`cat $new_mountlist | tr -s '\t' ' ' | grep " $old_mountpoint " | cut -d' ' -f2`
    39     dev=`cat $new_mountlist | tr -s '\t' ' ' | grep " $mtpt " | cut -d' ' -f1`
     38    mtpt=`tr -s '\t' ' ' < $new_mountlist | grep " $old_mountpoint " | cut -d' ' -f2`
     39    dev=`tr -s '\t' ' ' < $new_mountlist | grep " $mtpt " | cut -d' ' -f1`
    4040#   echo "NEW_MP (A) = $dev" >> /dev/stderr
    4141#    else
  • branches/2.06/mondo/mondo/restore-scripts/mondo/stabelilo-me

    r30 r275  
    8686
    8787WhatIsFirstDriveCalled() {
    88     cat /tmp/mountlist.txt | cut -d' ' -f1 \
     88    cut -d' ' -f1 /tmp/mountlist.txt \
    8989| sed s/[0-9]// | sed s/[0-9]// \
    90 | sort | uniq | head -n 1
     90| sort -u | head -n 1
    9191}
    9292
Note: See TracChangeset for help on using the changeset viewer.