I am trying to write a script that contains the following information:
4824597 11 : 26 / Home / Customer 1 / ITAM.XML . . 4824597 14:08 /home/customer46/ecds/dropoff/ITAM.xml I have another file that will log the same information
4824597 11 : 28 / Home / Customer1 / ITAM.xm . . . 4824597 14:11 /home/customer46/ecds/dropoff/ITAM.xml I have to see how much time it takes to get the file. To do this, I want to decrease the timestamp of all logged files, and subtract them from their initial timestamp in the log file first.
I am new to scripting and am struggling to do this work. I'm trying to:
#! / Bin / bash time = $ 11: 48: 30 days = $ 2012-10-12 time = $ 13: 13: 48T = $ (date-d "day time" +% s) t1 = $ (date - D "time of day 2" +% s) diff = $ (expr $ t1 - $ t) $ difcho echo There is no luck yet. Any help would be greatly appreciated.
Try something like this:
Awk '{sub (/: /, "", $ 2); T1 = MkTime (striptime ("% Y% m% d") "" $ 2 "00"); Join & lieutenant; "Input2.txt"; Sub (/: /, "", $ 2); T2 = MkTime (striptime ("% Y% m% d") "" $ 2 "00"); Print $ 3 ":" T2-T1 "s}} 'input1.txt
No comments:
Post a Comment