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

Patches from Sébastien Aperghis-Tramoni <maddingue@…>

replace several occurences of "cat .. | grep .."
or with similar commands that accept filenames as arguments.
+ some sort | uniq replaced by sort -u

File:
1 edited

Legend:

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

    r196 r273  
    335335           "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \
    336336file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
    337 cat $file.old | awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
    338 else { print $0;};}' > $file ; fi ; done");
     337awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
     338else { print $0;};}'$file.old > $file ; fi ; done");
    339339    run_program_and_log_output(tmp, 5);
    340340    paranoid_free(tmp);
     
    10981098#ifndef __FreeBSD__
    10991099    if (run_program_and_log_output
    1100         ("cat /proc/devices | grep ramdisk", FALSE)) {
     1100        ("grep ramdisk /proc/devices", FALSE)) {
    11011101        if (!ask_me_yes_or_no
    11021102            ("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?"))
     
    13901390    log_msg(4, "Done. Great. Seeting command to something");
    13911391    strcpy(command,
    1392            "cat /etc/fstab | grep -v \":\" | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1392           "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    13931393    log_msg(4, "Cool. Command = '%s'", command);
    13941394    strcpy(tmp, call_program_and_get_last_line_of_output(command));
Note: See TracChangeset for help on using the changeset viewer.