Ignore:
Timestamp:
Jan 3, 2006, 4:09:12 PM (15 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/X-specific.cpp

    r30 r273  
    197197    kapp->quit();
    198198    printf ("---FATAL ERROR--- %s\n", error);
    199     system ("cat /var/log/mondo-archive.log | gzip -9 > /tmp/MA.log.gz 2> /dev/null");
     199    system ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null");
    200200    printf ("If you require technical support, please contact the mailing list.\n");
    201201    printf ("See http://www.mondorescue.org for details.\n");
     
    252252  if (grep_for_me[0] != '\0')
    253253    {
    254       sprintf (command, "cat %s | grep \"%s\" | tail -n%d", filename,
    255            grep_for_me, NOOF_ERR_LINES);
     254      sprintf (command, "grep \"%s\" %s | tail -n%d",
     255           grep_for_me, filename, NOOF_ERR_LINES);
    256256    }
    257257  else
    258258    {
    259       sprintf (command, "cat %s | tail -n%d", filename, NOOF_ERR_LINES);
     259      sprintf (command, "tail -n%d %s", NOOF_ERR_LINES, filename);
    260260    }
    261261  fin = popen (command, "r");
Note: See TracChangeset for help on using the changeset viewer.