output of date & time to lp - Unix

This is a discussion on output of date & time to lp - Unix ; Hi I have a routine which creates a file every Friday. The number of records being created varies from week to week. I now need to amend the routine so that, at the end, I print a one-line summary report, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: output of date & time to lp

  1. output of date & time to lp

    Hi
    I have a routine which creates a file every Friday.
    The number of records being created varies from week to week.
    I now need to amend the routine so that, at the end,
    I print a one-line summary report, as follows :

    DD/MM/YY : HH:MM:SS : No of records output = nnn

    I do not know the syntax to do so,
    except that "wc -l" will give me the value of nnn.

    Can anyone give me the necessary coding ?

    Many thanks

  2. Re: output of date & time to lp

    What about something like this:

    #!/usr/bin/env bash

    custDate=$(date "+%D : %H:%M:%S")
    numRecords="$(ls|wc -l)"
    echo -e "$custDate : No. of records output = ${numRecords//[[:space:]]}"


    $ bash num_records
    09/16/11 : 00:22:22 : No. of records output = 6

+ Reply to Thread