Sponsored Content
Top Forums Shell Programming and Scripting Add hh:mm:ss using awk or bash Post 302499188 by vgersh99 on Wednesday 23rd of February 2011 02:38:28 PM
Old 02-23-2011
Code:
 nawk -F, '{n=split($3,a,":"); s+=(a[1]*3600+a[2]*60+a[3])}END{printf("%02d:%02d:%02d\n", s/3600,s%3600/60,s%3600%60)}' myFile

This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash - Add User script

Hey folks! I'm trying to work on a script that will add a user to the system. I have the complete script, but it's not working for me, and I'm not sure what to do. line 53: syntax error near unexpected token `0' ******************************************************** #!/bin/bash # # ... (4 Replies)
Discussion started by: niels.intl
4 Replies

2. Shell Programming and Scripting

BASH with AWK

Hello, I have a file.txt with 20000 lines and 2 columns each which consists of current_filename and new_filename . I want to create a script to find files in a directory with current_filename and move it to new folder with new_filename. Could you please help me how to do that?? ... (2 Replies)
Discussion started by: narasimhulu
2 Replies

3. Shell Programming and Scripting

awk bash help

Hi, I'm trying to read a file containing lines with spaces in them. The inputfile looks like this ------------------------------ Command1 arg1 arg2 Command2 arg5 arg6 arg7 ------------------------------- The shell code looks like this... lines=`awk '{ print }' inputfile` ... (2 Replies)
Discussion started by: a-gopal
2 Replies

4. Shell Programming and Scripting

bash scripting and awk help

Hey guys, i am fairly new to scripting and I am trying to write a script that takes a comma delimited file as input. I am trying to figure out a way to determine if $1 and $3 exist on a line (basically a hostname and ip address) and if true do the following, resolve the hostname to ip. sample... (6 Replies)
Discussion started by: streetfighter2
6 Replies

5. Shell Programming and Scripting

add up time with xx:yy format in bash how?

Hi, How can I add up a series of string like: and get a total as hour and minutes in a format like this: (3 Replies)
Discussion started by: bashily
3 Replies

6. UNIX for Advanced & Expert Users

how to add new options in bash script

what i want to be is that i would like to reinvent new options that have the same functionality as ... -u is the same functionality of conv=ucase and -l have the same functionality as conv=lcase... is there a way that i can put these in my script so that whenever i will typed in command... (12 Replies)
Discussion started by: aphryllyn1
12 Replies

7. UNIX for Dummies Questions & Answers

Help in awk/bash

Hi, I am also a newbie in awk and trying to find solution of my problem. I have one reference file 1.txt with 2 columns and I want to search other 10 files (a.txt, b.txt......h.txt each with 5 columns) corresponding to the values of 2nd column from 1.txt. If the value from 2nd column from 1.txt... (0 Replies)
Discussion started by: bioinfo
0 Replies

8. Shell Programming and Scripting

Help in awk/bash

Hi, I have two files: atom.txt and g.txt atom.txt has multiple patterns but I am showing only two patterns each ending with ENDMDL: ATOM 1 N SER A 1 35.092 83.194 140.076 1.00 0.00 N ATOM 2 CA SER A 1 35.216 83.725 138.725 1.00 0.00 C TER ENDMDL ATOM 1 N SER A 1 35.683 81.326 139.778 1.00... (11 Replies)
Discussion started by: bioinfo
11 Replies

9. Shell Programming and Scripting

Help in awk/bash

Hi, I am also a newbie in awk and trying to find solution of my problem. I have one reference file 1.txt with 2 columns and I want to search other 10 files (a.txt, b.txt......h.txt each with 5 columns) corresponding to the values of 2nd column from 1.txt. If the value from 2nd column from 1.txt... (33 Replies)
Discussion started by: bioinfo
33 Replies

10. Shell Programming and Scripting

Add another condition to bash for when not met

In the below I can not seem to add a line that will add Not low if the statement in bold is not true or meet. I guess when the first if statement is true/meet then print low, otherwise print Not low in $(NF + 1). I am not sure how to correctly add this. Thank you :). if(low <= $2 && $2 <=... (5 Replies)
Discussion started by: cmccabe
5 Replies
REDSHIFT(5)							 REDSHIFT.CONF(5)						       REDSHIFT(5)

NAME
redshift.conf - configuration file for redshift and gtk-redshift DESCRIPTION
A configuration file with the name `redshift.conf' can optionally be placed in `~/.config/'. The file has standard INI format. General pro- gram options are placed under the `redshift' header, while options for location providers and adjustment methods are placed under a header with the name of that provider or method. General options are: temp-day = integer Daytime temperature temp-night = integer Night temperature transition = 0 or 1 Disable or enable transitions brightness-day = 0.1-1.0 Screen brightness at daytime brightness-night = 0.1-1.0 Screen brightness at night gamma = R:G:B Gamma adjustment to apply adjustment-method = name Select adjustment method. Options for the adjustment method can be given under the configuration file heading of the same name. location-provider = name Select location provider. Options for the location provider can be given under the configuration file heading of the same name. Options for location providers and adjustment methods can be found in the help output of the providers and methods. EXAMPLE
Example for Copenhagen, Denmark: $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m vidmode -v An example configuration file with the same effect as the above command line: [redshift] temp-day=5700 temp-night=3600 gamma=0.8 adjustment-method=vidmode location-provider=manual AUTHOR
redshift was written by Martin Koelewijn and Jon Lund Steffensen. This manual page was created by Franziska Lichtblau <rhalina@old-forest.org> for the Debian project (and may be used by others). redshift 1.7 June 2012 REDSHIFT(5)
All times are GMT -4. The time now is 01:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy