10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am writing a script to find time difference between two timestamp stored in a variable.
i have two variable
t1=11:48:30
t2=13:13:48
how i can find the difference i.e t2-t1 in seconds.
Please help (4 Replies)
Discussion started by: anand2308
4 Replies
2. Shell Programming and Scripting
Hello all,
I have written sth like this:
#!/bin/bash
grep -e XXX -e YYYY myfile.log | grep -v ZZZ | awk '{print $1 " " $2 ";" $3 ";" $9 ";" $11}' > myfile.csv
sed -i '1iDate;Time;From;To' myfile.csv
=> it is clear that it converts log to csv and add a header.
Now I want to subtract row... (4 Replies)
Discussion started by: frhling
4 Replies
3. Shell Programming and Scripting
HI Guys,
I want to find out the script running time and subtract from sleeptime.
My Script Below Give me error :-
#!/usr/bin/ksh
timeout=100
start=$SECONDS
sleep 20
end=$SECONDS
echo "Time: $((end - start)) "
ScTime = $((end - start)) (1 Reply)
Discussion started by: asavaliya
1 Replies
4. UNIX for Dummies Questions & Answers
I have 2 files,
file01= 7 columns, row unknown (but few)
file02= 7 columns, row unknown (but many)
now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there
e.g.
file 01
James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies
5. Linux
Hi everyone,
how can I convert a file with 3375 rows and 6 columns to a file with
1350 rows and 15 columns
by using a script?
Is it possible with awk or something like that?
Any help is much appreciated.
Thanks.
D. (5 Replies)
Discussion started by: DKalfileritos
5 Replies
6. Shell Programming and Scripting
Hi Guys,
I need help in modifying a large text file containing more than 1-2 lakh rows of data using unix commands. I am quite new to the unix language
the text file contains data in a pipe delimited format
sdfsdfs
sdfsdfsd
START_ROW
sdfsd|sdfsdfsd|sdfsdfasdf|sdfsadf|sdfasdf... (9 Replies)
Discussion started by: manish2009
9 Replies
7. UNIX for Dummies Questions & Answers
Hi
I have a date in a variable in Unix script and have to subtract -1 from the date.
fromdate='07/13/2009'
Now we want to subract one day from it i.e the end result should be '07/12/2009'
Any suggestions?
Thanks (2 Replies)
Discussion started by: akashtcs
2 Replies
8. Shell Programming and Scripting
i find a script to calculate hours of job i(nclude extraordinary)
i make a script to calculate add and subtract two hours (format hh:mm:ss) (7 Replies)
Discussion started by: ZINGARO
7 Replies
9. UNIX for Dummies Questions & Answers
Hi Friends :)
I have a long file having fields in the form :
Field1 yy/mm/dd hh:mm:ss Duration(Sec)
line 1) 123123 05/11/30 12:12:56 145
line 2) 145235 05/11/30 12:15:15 30
line 3) 145264 05/11/30 13:14:56 178
.
.
I want to subtract yy/dd/dd hh:mm:ss in line (2) from yy/mm/dd hh:mm:ss in... (1 Reply)
Discussion started by: vanand420
1 Replies
10. UNIX for Dummies Questions & Answers
I write a sh script that zip and copy to tape all files that older then 2 hours.
1. The way I choose is - touch a file with "now - 2 hours", then use fine with '! -newer'
2. Do you have any other idea to do it ?
tnx. (1 Reply)
Discussion started by: yairon
1 Replies