User Commands  - ttee (1)

NAME

ttee(1f) - [TIME] write input to stdout and a file with timing info. (LICENSE:PD)

CONTENTS

Synopsis
Description
Limits
Examples
Author
License

SYNOPSIS

ttee [[ -o|--output] filename(s)] [ -a|--append] [ --timestamp FLAG]] ... [ -fmt FORMAT] [ --help | --version]

DESCRIPTION

Read from standard input and write to standard output and files with an optional timestamp in front of each line.

-o|--output FILENAME(S) specify name of output file(s). If the filenames are first the keyword -o|--output is optional.

-a|--append append to the given output file(s), do not overwrite

-t|--timestamp FLAG which files to add the timestamp to. Default is "all" Allowed values are stdout, output, all, none.

-fmt FORMAT Change format for timestamp prefix using a call to now(3f).

          Description                                        Example

Base time array: (1) %Y -- year, yyyy 2022 (2) %M -- month of year, 01 to 12 08 (3) %D -- day of month, 01 to 31 02 %d -- day of month, with suffix (1st, 2nd,...) 2nd (4) %Z -- minutes from UTC -0240 %z -- -+hh:mm from UTC -04:00 %T -- -+hhmm from UTC -0400 (5) %h -- hours, 00 to 23 03 %H -- hour (1 to 12, or twelve-hour clock) 3 %N -- midnight< AM <=noon; noon<= PM <midnight AM (6) %m -- minutes, 00 to 59 46 (7) %s -- sec, 00 to 59 47 (8) %x -- milliseconds 000 to 999 455 Conversions: %E -- Unix Epoch time 1659426407.455006 %e -- integer value of Unix Epoch time 1659426407 %J -- Julian date 2459793.824160393 %j -- integer value of Julian Date(Julian Day) 2459793 %O -- Ordinal day (day of year) 214 %o -- Whole days since Unix Epoch date 19206 %U -- day of week, 1..7 Sunday=1 3 %u -- day of week, 1..7 Monday=1 2 %i -- ISO week of year 1..53 31 %I -- iso-8601 week-numbering date(yyyy-Www-d) 2022-W31-2 Names: %l -- abbreviated month name Aug %L -- full month name August %w -- first three characters of weekday Tue %W -- weekday name Tuesday %p -- phase of moon Waxing crescent %P -- percent of way from new to full moon 31% Literals: %% -- a literal % % %t -- tab character %b -- blank character %B -- exclamation(bang) character ! %n -- new line (system dependent)

%q -- single quote (apostrophe) ’ %Q -- double quote " Program timing: %c -- CPU_TIME(3f) output .2323500000000000E-01 %C -- number of times this routine is used 1 %S -- seconds since last use of this format .000000000000000 %k -- time in seconds from SYSTEM_CLOCK(3f) 68611.47 %K -- time in clicks from SYSTEM_CLOCK(3f) 686114677

If no percent (%) is found in the format one of several alternate substitutions occurs.

If the format is composed entirely of one of the following keywords the following substitutions occur: "iso-8601", "iso" ==> %Y-%M-%DT%h:%m:%s%z 2022-08-02T03:46:47-04:00 "iso-8601W", "isoweek" ==> %I 2022-W31-2 "sql" ==> "%Y-%M-%D %h:%m:%s.%x" "2022-08-02 03:46:47.470" "sqlday" ==> "%Y-%M-%D" "2022-08-02" "sqltime" ==> "%h:%m:%s.%x" "03:46:47.470" "rfc-2822" ==> %w, %D %l %Y %h:%m:%s %T Tue, 02 Aug 2022 03:46:47 -0400 "rfc-3339" ==> %Y-%M-%DT%h:%m:%s%z 2022-08-02T03:46:47-04:00 "date" ==> %w %l %D %h:%m:%s UTC%z %Y Tue Aug 02 03:46:47 UTC-04:00 2022 "short" ==> %w, %l %d, %Y %H:%m:%s %N UTC%z Tue, Aug 2nd, 2022 3:46:47 AM UTC-04:00 "long"," " ==> %W, %L %d, %Y %H:%m:%s %N UTC%z Tuesday, August 2nd, 2022 3:46:47 AM UTC-04:00 "suffix" ==> %Y%D%M%h%m%s 20220208034647 "formal" ==> The %d of %L %Y The 2nd of August 2022 "lord" ==> the %d day of %L in the year of our Lord %Y the 2nd day of August in the year of our Lord 2022 "easter" ==> FOR THE YEAR OF THE CURRENT DATE: Easter day: the %d day of %L in the year of our Lord %Y "all" ==> A SAMPLE OF DATE FORMATS otherwise the following words are replaced with the most common macros: year %Y 2022 month %M 08 day %D 02 timezone %z -04:00 hour %h 03 minute %m 46 second %s 47 millisecond %x 471 epoch %e 1659426407 julian %j 2459793 ordinal %O 214 weekday %u 2 MONTH %L July Month %l Jul DAY %d 7th HOUR %H 10 GOOD %N AM Weekday %w Thu WEEKDAY %W Thursday Timezone %Z -240 TIMEZONE %z -04:00 if none of these keywords are found then every letter that is a macro is assumed to have an implied percent in front of it. For example: YMDhms ==> %Y%M%D%h%m%s ==> 20220802034647

--help display this help and exit
--version
  output version information and exit

LIMITS

Program limits:
o Input line width maximum is 1024 characters.
o Maximum length of output filenames is 4098, individual filename is 1024.
o Minimum number of output files is probably at least 90; but is system dependent.

EXAMPLES

Basic command usage:

    # write stdout of "program" to ttee.out with a timestamp and stdout
    program|ttee --output ttee.out --timestamp output|grep -i iteration

# write stdout of "program" to log.txt and stdout with a Julian Day program|ttee log.txt -fmt "%J :" 2457565.488 :Iteration 1 : Error: 1.20 2457565.558 :Iteration 2 : Error: 0.08 2467569.684 :Iteration 3 : Error: 1.2e-3

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 ttee (1) July 22, 2023
Generated by manServer 1.08 from ea2453c4-5f13-40ea-bbd9-9bf3164078e0 using man macros.