Sponsored Content
Top Forums Shell Programming and Scripting Explanation for printf string in awk Post 302400026 by maxim42 on Tuesday 2nd of March 2010 05:18:04 AM
Old 03-02-2010
Explanation for printf string in awk

hi all
can any one help me to understand this
Code:
bdf -t vfxs | awk '/\//{printf("%-30s%-10s%-10s%-10s%-5s%-10s\n",$1,$2,$3,$4,$5,$6)}'

i want to understand the numbers %-30S%

Last edited by pludi; 03-02-2010 at 04:31 PM.. Reason: clarified title
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK explanation

Hi, Could anyone please explain why we have arr=1 - what does this statement do? awk -F\; 'FNR==NR{arr=1;next};$3 in arr' core.txt gmrd.txt Any help appreciated (2 Replies)
Discussion started by: penfold
2 Replies

2. Shell Programming and Scripting

find: problems escaping printf-command string

Hi Folks! Can you help me with this find -printf command. I seem to be unable to execute the printf-command from my shell script. I'm confused: :confused: My shell script snippet looks like this: #!/bin/sh .. COMMAND="find ./* -printf '%p %m %s %u %g \n'" echo "Command: ${COMMAND}"... (1 Reply)
Discussion started by: grahamb
1 Replies

3. Shell Programming and Scripting

awk printf formatting using string format specifier.

Hi all, My simple AWK code does C = A - B If C can be a negative number, how awk printf formating handles it using string format specifier. Thanks in advance Kanu :confused: (9 Replies)
Discussion started by: kanu_pathak
9 Replies

4. Shell Programming and Scripting

printf with Character String

I am trying to use printf with a character string that is used within a do loop. The problem is that while in the loop, the printf prints the variable name instead of the value. The do loop calls the variable name from a text file (called device.txt): while read device do cat $device.clean... (2 Replies)
Discussion started by: dleblanc67
2 Replies

5. Shell Programming and Scripting

Help formatting a string. Something like printf?

Hi I'm having a problem with converting a file: ID X 1 7 1 8 1 3 2 5 2 7 2 2 To something like this: ID X1 X2 X3 1 7 8 3 2 5 7 2 I've tried the following loop: for i in `cat tst.csv| awk -F "," '{print $1}'| uniq`;do grep -h $i... (4 Replies)
Discussion started by: flotsam
4 Replies

6. Shell Programming and Scripting

String formatting using awk printf

Hi Friends, I am trying to insert lines of the below format in a file: # x3a4914 Joe 2010/04/07 # seh Lane 2010/04/07 # IN01379 Larry 2010/04/07 I am formatting the strings as follows using awk printf: awk 'printf "# %s %9s %18s\n", $2,$3,$4}' ... (2 Replies)
Discussion started by: sugan
2 Replies

7. Shell Programming and Scripting

awk explanation

Hello, I have recently come across this awk program. Can some one shed some light on what is taking place. awk '{!a++}END{for(i in a) if ( a >10 ) print a,i }' $FILE Best Regards, jaysunn (1 Reply)
Discussion started by: jaysunn
1 Replies

8. Shell Programming and Scripting

How to print a string using printf?

I want to print a string say "str1 str2 str3 str4" using printf. If I try printing it using printf it is printing as follows. output ------- str1 str2 str3 str4 btw I'm working in AIX. This is my first post in this forum :) regards, rakesh (4 Replies)
Discussion started by: enigmatrix
4 Replies

9. Shell Programming and Scripting

Unable to match string within awk printf

Hi All I am working to process txt file into csv commo separated. Input.txt 1,2,asdf,34sdsd,120,haahha2 2,2,wewedf,45sdsd,130,haahha ..... .... Errorcode.txt 120 130 140 myawk.awk code: { BEGIN{ HEADER="f1,f2,f3,f4,f5,f6" (4 Replies)
Discussion started by: krsnadasa
4 Replies

10. Shell Programming and Scripting

Printf padded string

Is possible to print padded string in printf? Example echo 1 | awk '{printf("%03d\n", $1)}' 001I want S1 S11 S2 S21to be padded as: S01 S11 S02 S21Thanks! (26 Replies)
Discussion started by: yifangt
26 Replies
OCF_HEARTBEAT_SFEX(7)						OCF resource agents					     OCF_HEARTBEAT_SFEX(7)

NAME
ocf_heartbeat_sfex - Manages exclusive access to shared storage using Shared Disk File EXclusiveness (SF-EX) SYNOPSIS
sfex [start | stop | monitor | meta-data | validate-all] DESCRIPTION
Resource script for SF-EX. It manages a shared storage medium exclusively . SUPPORTED PARAMETERS
device Block device path that stores exclusive control data. (required, string, no default) index Location in block device where exclusive control data is stored. 1 or more is specified. Default is 1. (optional, integer, default 1) collision_timeout Waiting time when a collision of lock acquisition is detected. Default is 1 second. (optional, integer, default 1) monitor_interval Monitor interval(sec). Default is 10 seconds (optional, integer, default 10) lock_timeout Valid term of lock(sec). Default is 100 seconds. The lock_timeout is calculated by the following formula. .sp lock_timeout = monitor_interval + "The expiration time of the lock" .sp We suggest 90 seconds as a default value of the "The expiration time of the lock", but you should change it in consideration of access delay to the shared disk and the switch time of the multipath driver. .sp The lock timeout have an impact on start action timeout because start action timeout value is calculated by the following formula. .sp start timeout = collision_timeout + lock_timeout + "safety margin" .sp The "safety margin" is decided within the range of about 10-20 seconds(It depends on your system requirement). (optional, integer, default 100) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 120s. stop Stops the resource. Suggested minimum timeout: 20s. monitor Performs a detailed status check. Suggested minimum timeout: 10s. Suggested interval: 10s. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5s. EXAMPLE
The following is an example configuration for a sfex resource using the crm(8) shell: primitive p_sfex ocf:heartbeat:sfex params device=string op monitor depth="0" timeout="10s" interval="10s" SEE ALSO
http://www.linux-ha.org/wiki/sfex_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 03/09/2014 OCF_HEARTBEAT_SFEX(7)
All times are GMT -4. The time now is 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy