10-26-2011
nawk time substracting
Nawk ‘BEGIN {printf “0t%d=Y\n”,srand () -1800}' | adb
I know that printf is printing the value in %d which is for a day of the month and subtracting the value by -1800 (30 minutes).
So if date is 14:25:45 subtracting from 1800 then time will equal to 13:55:45
I also know that srand () is function that is used to set a new seed for the random number generator.
However I don't know what is 0t doing? What is for?Is | adb - debugging the code?
Also what I want is to store the workout value in variable (so every time I run the script it subtracts 30 minutes from current time and stores the value in variable). So I can use the variable in loop which will check all the logs created 30 minutes ago. I can't use gawk
Any help will be greatly appreciated
Thank you all
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am using solaris and nawk.
Is there any time function in nawk which is simliar to the shell `date` function ?
Can any experts show any examples? (4 Replies)
Discussion started by: Raynon
4 Replies
2. Shell Programming and Scripting
i'm new to shell scripting and have a problem please help me
in the script i have a nawk block which has a variable count
nawk{
.
.
.
count=count+1
print count
}
now i want to access the value of the count variable outside the awk block,like..
s=`expr count / m`
(m is... (5 Replies)
Discussion started by: saniya
5 Replies
3. Shell Programming and Scripting
Hi,
I have two files with with similar row names. For the names that match, I want to substract the values from each column.
eg (files are tab separeted).
FILE1:
hhh 2 4 5
KKL 2 3 2
LLP 2 1 2
FILE2:
hhh 3 1 1
KKL 2 1 1
UUI 1 1 1 (10 Replies)
Discussion started by: kylle345
10 Replies
4. AIX
I've start and end time in two columns. How can I substract time from column 2 and column 1 and receive output in another file 'd' ?
Code:
$ cat c
12:55:04 2:03:56
2:03:56 3:20:17
14:00:00 13:05:00 (1 Reply)
Discussion started by: alps0206
1 Replies
5. Shell Programming and Scripting
hi people;
this is my two awk code:
nawk '/cell+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt
nawk -F'*' '{gsub(/ *$/,"")}$0=$1$($NF-2)'... (2 Replies)
Discussion started by: gc_sw
2 Replies
6. Shell Programming and Scripting
hi,
i've got an input file that contains
12345678 AAA
12345679 BBB
12345680 CCC
where 1st column is epoch time while the second column are some string.
I'm using nawk to do regular expression on the 2nd column and i need to convert the epoch time to human readable time e.g. 'yyyymmdd... (5 Replies)
Discussion started by: bing
5 Replies
7. Shell Programming and Scripting
Hi,
I want to subtract 'n' days from the current timestamp in a k shell script. Is there any inbuilt function to do it
or any workaround solution to get the date. And I want the output to be in YYYY:MM:DD HH:MM:SS format. Please help.
Thanks in advance. (4 Replies)
Discussion started by: Suryaaravindh
4 Replies
8. Shell Programming and Scripting
Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do.
What am I trying to do?
I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies
9. Shell Programming and Scripting
Hello!
I'm new to linux programming. It would be great if you could help me out.
I have a matrix of kind:
10 30.0
20 190.5
40 180.
50 320.5
I would like
to substract 180 from column 2 If the value is >180
to add 180 for column 2 If the value is <180
nothing if it is equal to... (3 Replies)
Discussion started by: lovelinux
3 Replies
10. Shell Programming and Scripting
Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare
nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies
LEARN ABOUT DEBIAN
seqdiag
SEQDIAG(1) General Commands Manual SEQDIAG(1)
NAME
seqdiag - generate sequence-diagram image file from spec-text file.
SYNOPSIS
seqdiag [options] file
DESCRIPTION
This manual page documents briefly the seqdiag commands.
seqdiag is generate sequence-diagram image file from spec-text file.
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below. For a complete description, see the Info files.
--version
show program's version number and exit
-h, --help
show this help message and exit
-a, --antialias
Pass diagram image to anti-alias filter
-c FILE, --config=FILE
read configurations from FILE
-o FILE
write diagram to FILE
-f FONT, --font=FONT
use FONT to draw diagram
-T TYPE
Output diagram as TYPE format
SEE ALSO
The programs are documented fully by
http://tk0miya.bitbucket.org/seqdiag/build/html/index.html
AUTHOR
seqdiag was written by Takeshi Komiya <i.tkomiya@gmail.com>
This manual page was written by Kouhei Maeda <mkouhei@palmtb.net>, for the Debian project (and may be used by others).
May 21, 2011 SEQDIAG(1)