Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Seperate columns according to delimiters Post 302724807 by Yoda on Thursday 1st of November 2012 10:12:06 AM
Old 11-01-2012
Code:
awk -F"-" 'BEGIN { printf("%-10s %-20s %-10s\n", "clomun 1", "clomun 2", "clomun 3"); } !/clomun/ { printf("%-10s %-20s %-10s\n", $1,$2,$3); } ' input_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

row seperate

i have this sample data: test01 --- abc-01 name1 abc-02 name2 abc-03 name3 test02 --- abc-20 name4 abc-21 name5 test03 --- abc-22 name6 abc-23 name7 i want to generate a file... (13 Replies)
Discussion started by: inquirer
13 Replies

2. Shell Programming and Scripting

Need help to seperate data

Hello ALL, I really need help to grep data and store in particular format. I am struggling to write that script .Please help me to solve this problem otherwise i will loose my job... I have to compare 2 files and generate the staticts of the data. First file product.dat contains 2 column . ... (4 Replies)
Discussion started by: getdpg
4 Replies

3. Shell Programming and Scripting

Seperate commands on the same line

hello, is there a way to seperate commands that are on the same line? ie: echo "yes count(*)>0:" $passvar > dsp cat dsp cat dsp > log i'm trying to put these 3 commands on the same line, but when i do they all get concatenated into 1 lieteral if i put the cat commands on... (3 Replies)
Discussion started by: bobk544
3 Replies

4. Shell Programming and Scripting

seperate elements of a file

i want to write a script in Bash Shell that accept a list of files.an example of file is 4334:234 322.345:32 234:3452 e.t.c each file only contain lines like num1:num2 i want to count the lines of this file and find the summary of X=4334+322.345+234 and Y=234+32+3452 (1 Reply)
Discussion started by: nektarios4u
1 Replies

5. Shell Programming and Scripting

how to seperate a variable in 2 variables

Dear all, i dont know how to split one variable value in 2 variable. please send me any example. variable1= "abcde developer" now i want to seperate the values and seperator is space. (6 Replies)
Discussion started by: intikhabalam
6 Replies

6. Shell Programming and Scripting

Cutting a file with multiple delimiters into columns

Hi All I have recently had to start using Unix for work and I have hit brick wall with this prob.... I have a file that goes a little something like this.... EUR;EUR;EUR:USD:USD;USD;;;EUR/USD;XAU/AUD;XAU/EUR;XAU/AUD,GBP/BOB,UAD/XAU;;;1.11;2.22;3.33;4.44;5.55;6.66;;; is it possible to... (7 Replies)
Discussion started by: luckycharm
7 Replies

7. UNIX for Dummies Questions & Answers

How to seperate two lines that are joined?

i have something like this abc 123 3234 1234 * qqoiki * abc 4533 34 1234 * lloiki * i want to make it two lines i,e.,abc 123 3234 1234 * qqoiki * abc 4533 34 1234 * lloiki * how to do that ? (13 Replies)
Discussion started by: anurupa777
13 Replies

8. Shell Programming and Scripting

Insert Columns before the last Column based on the Count of Delimiters

Hi, I have a requirement where in I need to insert delimiters before the last column of the total delimiters is less than a specified number. Say if the delimiters is less than 139, I need to insert 2 columns ( with blanks) before the last field awk -F 'Ç' '{ if (NF-1 < 139)} END { "Insert 2... (5 Replies)
Discussion started by: arunkesi
5 Replies

9. Shell Programming and Scripting

Extract columns into seperate file

I have a comma delimited file as per the one below and I am currently extracting the values in 2 columns (COL1 & COL6) to produce a smaller trimmed down version of the file which only contains the columns we need; COL1,COL2,COL3,COL4,COL5,COL6,COL7,COL8,COL9... (1 Reply)
Discussion started by: Ads89
1 Replies

10. UNIX for Beginners Questions & Answers

For loop for seperate files

For shell script. If I had two separate files, file.txt and file1.txt and each has just a list of names from the who command. How would I create an if loop to compare each name? (1 Reply)
Discussion started by: Eric7giants
1 Replies
OCF_HEARTBEAT_ETHMON(7) 					OCF resource agents					   OCF_HEARTBEAT_ETHMON(7)

NAME
ocf_heartbeat_ethmonitor - Monitors network interfaces SYNOPSIS
ethmonitor [start | stop | status | monitor | meta-data | validate-all] DESCRIPTION
Monitor the vitality of a local network interface. You may set up this RA as a clone resource to monitor the network interfaces on different nodes, with the same interface name. This is not related to the IP address or the network on which a interface is configured. You may use this RA to move resources away from a node, which has a faulty interface or prevent moving resources to such a node. This gives you independend control of the resources, without involving cluster intercommunication. But it requires your nodes to have more than one network interface. The resource configuration requires a monitor operation, because the monitor does the main part of the work. In addition to the resource configuration, you need to configure some location constraints, based on a CIB attribute value. The name of the attribute value is configured in the 'name' option of this RA. Example constraint configuration: location loc_connected_node my_resource_grp rule ="rule_loc_connected_node" -INF: ethmonitor eq 0 The ethmonitor works in 3 different modes to test the interface vitality. 1. call ip to see if the link status is up (if link is down -> error) 2. call ip and watch the RX counter (if packages come around in a certain time -> success) 3. call arping to check whether any of the IPs found in the local ARP cache answers an ARP REQUEST (one answer -> success) 4. return error SUPPORTED PARAMETERS
interface The name of the network interface which should be monitored (e.g. eth0). (unique, required, string, no default) name The name of the CIB attribute to set. This is the name to be used in the constraints. Defaults to "ethmonitor-'interface_name'". (unique, optional, string, no default) multiplier Multiplier for the value of the CIB attriobute specified in parameter name. (optional, integer, default 1) repeat_count Specify how often the interface will be monitored, before the status is set to failed. You need to set the timeout of the monitoring operation to at least repeat_count * repeat_interval (optional, integer, default 5) repeat_interval Specify how long to wait in seconds between the repeat_counts. (optional, integer, default 10) pktcnt_timeout Timeout for the RX packet counter. Stop listening for packet counter changes after the given number of seconds. (optional, integer, default 5) arping_count Number of ARP REQUEST packets to send for every IP. Usually one ARP REQUEST (arping) is send (optional, integer, default 1) arping_timeout Time in seconds to wait for ARP REQUESTs (all packets of arping_count). This is to limit the time for arp requests, to be able to send requests to more than one node, without running in the monitor operation timeout. (optional, integer, default 1) arping_cache_entries Maximum number of IPs from ARP cache list to check for ARP REQUEST (arping) answers. Newest entries are tried first. (optional, integer, default 5) 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. status Performs a status check. Suggested minimum timeout: 20s. Suggested interval: 10s. monitor Performs a detailed status check. Suggested minimum timeout: 20s. 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: 20s. EXAMPLE
The following is an example configuration for a ethmonitor resource using the crm(8) shell: primitive p_ethmonitor ocf:heartbeat:ethmonitor params interface=string op monitor depth="0" timeout="20s" interval="10s" SEE ALSO
http://www.linux-ha.org/wiki/ethmonitor_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 06/09/2014 OCF_HEARTBEAT_ETHMON(7)
All times are GMT -4. The time now is 11:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy