Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Shell script to split data with a delimiter having chars and special chars Post 303038078 by RudiC on Friday 23rd of August 2019 03:45:55 PM
Old 08-23-2019
WHAT "is not working"? Any error messages?


If it's about awk not being happy with the field separator try escaping the square brackets:
Code:
dlm="<SelectStatement modified='1' type='string'><\!\\[CDATA\\["
awk -F"$dlm" '{print $2}' file
 SELECT

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Supress special chars in vi

Hi, One of our application is producing log files. But if we open the log file in vi or less or view mode, it shows all the special characters in it. The 'cat' shows correctly but it shows only last page. If I do 'cat' <file_name> | more, then again it shows special characters. ... (1 Reply)
Discussion started by: divakarp
1 Replies

2. Shell Programming and Scripting

treating special chars

Hi, I need some advise on treating non printable chars over ascii value 126 Case 1 : On some fields in the text , I need to retiain then 'as-is' and load to a database.I understand it also depends on database codepage. but i just wanna know how do i ensure it do not change while loading... (1 Reply)
Discussion started by: braindrain
1 Replies

3. Shell Programming and Scripting

special chars arrangement in code

here is my simple script to show process and owners except me: ps `-ef |grep xterm |grep -v aucar` | while read a1 a2 a3 a4 a5 a6 a7 a8 do echo KILL..\($a1\).. $a2 |more done how can I pass values from command "ps -ef |grep xterm|grep -v aucar" to ? because above command... (2 Replies)
Discussion started by: xramm
2 Replies

4. Shell Programming and Scripting

How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code: grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d' Emacs will then position me in the correct file and at the correct line... (0 Replies)
Discussion started by: siegfried
0 Replies

5. Shell Programming and Scripting

find 4 chars on 2nd line, 44 chars over

I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :( I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Discussion started by: unclecameron
4 Replies

6. UNIX for Dummies Questions & Answers

Strings with Special chars in IF condition

I was trying to run a code to check if a fax number is empty or not. for that, I've written the following code which is throwing an error. #!/bin/ksh fax= "999-999-9999" if ; then fax_no="000-000-0000" else fax_no=$fax fi echo $fax_no And I get the... (7 Replies)
Discussion started by: hooaamai
7 Replies

7. Shell Programming and Scripting

All strings within two special chars

I have a file with multiple lines. From each line I want to get all strings that starts with '+' and ends with '/'. Then I want the strings to be separated by ' + ' Example input: +$A$/NOUN+At/NSUFF_FEM_PL+K/CASE_INDEF_ACC Sample output: $A$ + At + K (20 Replies)
Discussion started by: Viernes
20 Replies

8. Shell Programming and Scripting

If condition matching with special chars

Hi, I have file #cat drivers.txt fcs0 fcs1 vscsi1 vscsi2 In this i need to check the availabality of "fcs" or "vscsi" alone not vscsi0,fcs1 I tried with "if condition" but it is not working. cat drivers.txt| while read ADAP do echo "Checking for $ADAP" if ;then echo "FC... (9 Replies)
Discussion started by: ksgnathan
9 Replies

9. UNIX for Advanced & Expert Users

Inserting delimiter after a specific number of chars

Hello guys, I have a problem where I need to add a delimiter, that can be | for example, after each 28000 chars. The problem is that sometimes 1 row, which should contain 28000 chars is split in 2, so I want to put the delimiter after each 28000 so I will know the end of each row. Please... (2 Replies)
Discussion started by: Diogo R Jesus
2 Replies

10. Shell Programming and Scripting

shell scripting to determine special chars in file

Hi, I need all your help to achieve the below functionality. I have a big 2 GB file and inside the file we need to identify, whether having a comma(,) or pipe(|) or tab or fixed position or semicolon(;) delimiter. If any of those delimiter found need to replace the file with pipe(|)... (1 Reply)
Discussion started by: lkeswar
1 Replies
DLM_CONTROLD(8) 						      cluster							   DLM_CONTROLD(8)

NAME
dlm_controld - daemon that configures dlm according to cluster events SYNOPSIS
dlm_controld [OPTIONS] DESCRIPTION
The dlm lives in the kernel, and the cluster infrastructure (corosync membership and group management) lives in user space. The dlm in the kernel needs to adjust/recover for certain cluster events. It's the job of dlm_controld to receive these events and reconfigure the kernel dlm as needed. dlm_controld controls and configures the dlm through sysfs and configfs files that are considered dlm-internal interfaces. The cman init script usually starts the dlm_controld daemon. OPTIONS
Command line options override a corresponding setting in cluster.conf. -D Enable debugging to stderr and don't fork. See also dlm_tool dump in dlm_tool(8). -L Enable debugging to log file. See also logging in cluster.conf(5). -K Enable kernel dlm debugging messages. See also log_debug below. -r num dlm kernel lowcomms protocol, 0 tcp, 1 sctp, 2 detect. 2 selects tcp if corosync rrp_mode is "none", otherwise sctp. Default 2. -g num groupd compatibility mode, 0 off, 1 on. Default 0. -f num Enable (1) or disable (0) fencing recovery dependency. Default 1. -q num Enable (1) or disable (0) quorum recovery dependency. Default 0. -d num Enable (1) or disable (0) deadlock detection code. Default 0. -p num Enable (1) or disable (0) plock code for cluster fs. Default 1. -l num Limit the rate of plock operations, 0 for no limit. Default 0. -o num Enable (1) or disable (0) plock ownership. Default 1. -t ms Plock ownership drop resources time (milliseconds). Default 10000. -c num Plock ownership drop resources count. Default 10. -a ms Plock ownership drop resources age (milliseconds). Default 10000. -P Enable plock debugging messages (can produce excessive output). -h Print a help message describing available options, then exit. -V Print program version information, then exit. FILES
cluster.conf(5) is usually located at /etc/cluster/cluster.conf. It is not read directly. Other cluster components load the contents into memory, and the values are accessed through the libccs library. Configuration options for dlm (kernel) and dlm_controld are added to the <dlm /> section of cluster.conf, within the top level <cluster> section. Kernel options protocol The network protocol can be set to tcp, sctp or detect which selects tcp or sctp based on the corosync rrp_mode configuration (redundant ring protocol). The rrp_mode "none" results in tcp. Default detect. <dlm protocol="detect"/> timewarn After waiting timewarn centiseconds, the dlm will emit a warning via netlink. This only applies to lockspaces created with the DLM_LSFL_TIMEWARN flag, and is used for deadlock detection. Default 500 (5 seconds). <dlm timewarn="500"/> log_debug DLM kernel debug messages can be enabled by setting log_debug to 1. Default 0. <dlm log_debug="0"/> clusternode/weight The lock directory weight can be specified one the clusternode lines. Weights would usually be used in the lock server configura- tions shown below instead. <clusternode name="node01" nodeid="1" weight="1"/> Daemon options enable_fencing See command line description. <dlm enable_fencing="1"/> enable_quorum See command line description. <dlm enable_quorum="0"/> enable_deadlk See command line description. <dlm enable_deadlk="0"/> enable_plock See command line description. <dlm enable_plock="1"/> plock_rate_limit See command line description. <dlm plock_rate_limit="0"/> plock_ownership See command line description. <dlm plock_ownership="1"/> drop_resources_time See command line description. <dlm drop_resources_time="10000"/> drop_resources_count See command line description. <dlm drop_resources_count="10"/> drop_resources_age See command line description. <dlm drop_resources_age="10000"/> plock_debug Enable (1) or disable (0) plock debugging messages (can produce excessive output). Default 0. <dlm plock_debug="0"/> Disabling resource directory Lockspaces usually use a resource directory to keep track of which node is the master of each resource. The dlm can operate without the resource directory, though, by statically assigning the master of a resource using a hash of the resource name. To enable, set the per- lockspace nodir option to 1. <dlm> <lockspace name="foo" nodir="1"> </dlm> Lock-server configuration The nodir setting can be combined with node weights to create a configuration where select node(s) are the master of all resources/locks. These master nodes can be viewed as "lock servers" for the other nodes. <dlm> <lockspace name="foo" nodir="1"> <master name="node01"/> </lockspace> </dlm> or, <dlm> <lockspace name="foo" nodir="1"> <master name="node01"/> <master name="node02"/> </lockspace> </dlm> Lock management will be partitioned among the available masters. There can be any number of masters defined. The designated master nodes will master all resources/locks (according to the resource name hash). When no masters are members of the lockspace, then the nodes revert to the common fully-distributed configuration. Recovery is faster, with little disruption, when a non-master node joins/leaves. There is no special mode in the dlm for this lock server configuration, it's just a natural consequence of combining the "nodir" option with node weights. When a lockspace has master nodes defined, the master has a default weight of 1 and all non-master nodes have weight of 0. An explicit non-zero weight can also be assigned to master nodes, e.g. <dlm> <lockspace name="foo" nodir="1"> <master name="node01" weight="2"/> <master name="node02" weight="1"/> </lockspace> </dlm> In which case node01 will master 2/3 of the total resources and node2 will master the other 1/3. SEE ALSO
dlm_tool(8), fenced(8), cman(5), cluster.conf(5) cluster 2009-01-18 DLM_CONTROLD(8)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy