You could do this all in one awk without declaring multiple awk results to shell variables. When using in printf in shell or awk etc., you can use decimal values etc. to format the output so you have fixed widths between the values.
$ cat file
a:12:56:12
b:23:12:23
d:32:24:12
c:90:12:24
required output:
a:12:56:12
b:23:12:23
d:32:24:12
c:90:12:24
t:157:104:71
t line is the total line, which will be the last line in the output.
Please help.
I tried this: (4 Replies)
I am trying to use awk to create a summary of a structured file. Here is what it looks like:
(random text)
H1 H2 H3 H4
44 78 99 30
31 -- 32 21
12 33 55 21
I'd like to be able to specify a column, say H2, and then have information about that column printed. ... (4 Replies)
I have a data file similar to this (but many millions of lines long). You can assume that it is totally unsorted but has no duplicate rows.
Date ,Tool_Type ,Tool_ID ,Time_Used
3/13/2014,Screwdriver,Screwdriver02, 6
3/13/2014,Screwdriver,Screwdriver02,20... (2 Replies)
Hello , I have several files which are looking similar to :
file01.txt
keyA001 350 X string001 value001
keyA001 450 X string002 value007
keyA001 454 X string002 value004
keyA001 500 X string003 value005
keyA001 255 X string004 value006
keyA001 388 X string005 value008
keyA001 1278 X... (4 Replies)
Discussion started by: alex2005
4 Replies
LEARN ABOUT SUSE
ocf_heartbeat_postfix
OCF_HEARTBEAT_POSTFI(7) OCF resource agents OCF_HEARTBEAT_POSTFI(7)NAME
ocf_heartbeat_postfix - Manages a highly available Postfix mail server instance
SYNOPSIS
postfix [start | stop | reload | monitor | validate-all | meta-data]
DESCRIPTION
This script manages Postfix as an OCF resource in a high-availability setup. Tested with Postfix 2.5.5 on Debian 5.0.
SUPPORTED PARAMETERS
binary
Full path to the Postfix binary. For example, "/usr/sbin/postfix". (optional, string, default /usr/sbin/postfix)
config_dir
Full path to a Postfix configuration directory. For example, "/etc/postfix". (optional, string, no default)
parameters
The Postfix daemon may be called with additional parameters. Specify any of them here. (optional, string, no default)
SUPPORTED ACTIONS
This resource agent supports the following actions (operations):
start
Starts the resource. Suggested minimum timeout: 20s.
stop
Stops the resource. Suggested minimum timeout: 20s.
reload
Suggested minimum timeout: 20s.
monitor
Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 60s.
validate-all
Performs a validation of the resource configuration. Suggested minimum timeout: 20s.
meta-data
Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.
EXAMPLE
The following is an example configuration for a postfix resource using the crm(8) shell:
primitive example_postfix ocf:heartbeat:postfix
op monitor depth="0" timeout="20s" interval="60s"
SEE ALSO
http://www.linux-ha.org/wiki/postfix_(resource_agent)
AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors)
resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_POSTFI(7)