in reply to o/p of system

As you've been told in the CB already, split is the answer for your questions, on many levels.

  1. Replace grep with the builtin grep.
  2. Replace cut with split.
  3. Split up the date on the slash ("/") and join it together again in YYYYMMDD form.
  4. Sort it according to the date

Replies are listed 'Best First'.
Re^2: o/p of system
by johngg (Canon) on Oct 15, 2007 at 15:18 UTC
    split up the date on the slash ("/") and join it together again in YYYYMMDD form.

    I'm puzzled as to why you need to do that. Surely you could just sort it as it is without taking out the slashes. The OP still has the slashes in the desired output and a lexical sort will cope with the data as there are leading zeros for single-digit values. I missed the exchange in the CB but was the requirement to remove slashes mentioned there?

    Cheers,

    JohnGG

      That's an error on my part. Whenever I see dates delimited with slashes, I get the shivers because I can never be sure whether the date is in DD/MM/YYYY or MM/DD/YYYY form. Of course, here in this post, the date already was in a directly sortable order so the split/join was superfluous.

Re^2: o/p of system
by johny (Novice) on Oct 15, 2007 at 14:11 UTC
    Tnx Corion will try grep and split. Regards Johny