Need to add date to script -

Stallworth, Shirley Shirley.Stallworth at sinclair.edu
Thu Nov 12 19:39:04 UTC 2009


Hi Chris,

The only comment that I would add to this suggestion it to take note
that all shell logic references logical lines.  6 logical lines equates
to pressing the enter key 6 times.  If this is what you mean rather than
phyically seeing 6 lines then you are okay.

Shirley 

-----Original Message-----
From: fedora-list-bounces at redhat.com
[mailto:fedora-list-bounces at redhat.com] On Behalf Of Chris Tyler
Sent: Thursday, November 12, 2009 12:49 PM
To: Community assistance, encouragement,and advice for using Fedora.
Subject: Re: Need to add date to script -

On Thu, 2009-11-12 at 12:19 -0500, Bob Goodwin wrote:
>     I would like to have a "date" command inserted to separate each
>     group of six lines. Can some one tell me how to do that or point
me
>     in the right direction.


To add a date every 6 lines, you could pipe your output through
something like:

|(x=5; while read LINE; do if ((x++==5)) ; then date ; x=0 ; fi ; echo
$LINE ; done)

-Chris

--
fedora-list mailing list
fedora-list at redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines:
http://fedoraproject.org/wiki/Communicate/MailingListGuidelines




More information about the fedora-list mailing list