Sponsored Content
Top Forums Shell Programming and Scripting how to handle variables in sed Post 302123769 by LAKSHMI NARAYAN on Wednesday 27th of June 2007 07:16:04 AM
Old 06-27-2007
<XMLFORMAT>
<customernumberR11>9</customernumberR11>
<newnumberR11>30</newnumberR11>
<customerdetailR11>

</XMLFORMT>
<XMLFORMAT>
<customernumberR11>20</customernumberR11>
<newnumberR11>18</newnumberR11>
<customerdetailR11>

</XMLFORMT>
<XMLFORMAT>
<customernumberR11>11</customernumberR11>
<newnumberR11>32</newnumberR11>
<customerdetailR11>

</XMLFORMT>


expected output:
<XMLFORMAT>
<customernumberR11>30</customernumberR11>
<newnumberR11>30</newnumberR11>
<customerdetailR11>

</XMLFORMT>
<XMLFORMAT>
<customernumberR11>18</customernumberR11>
<newnumberR11>18</newnumberR11>
<customerdetailR11>

</XMLFORMT>
<XMLFORMAT>
<customernumberR11>32</customernumberR11>
<newnumberR11>32</newnumberR11>
<customerdetailR11>

</XMLFORMT>
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

flexible sed command needed to handle multiple input types

Hello, I need a smart sed command that can take any of the following two as an input and give below mentioned output. As you can see, I am trying to convert some C code INPUT: struct abc_sample1 { char myString; UINT16 myValue1; ... (2 Replies)
Discussion started by: SiftinDotCom
2 Replies

2. UNIX for Dummies Questions & Answers

sed using variables

Hi, I am able to use sed if I hardcode the find and replace values in a shell script. This works: sed -e 's/123v/4567/g' /path/aaa.txt > /path/aaa.txt.tmp If I use a variable, I am not able to use sed command. why? This doesnot work: i=abc j=bk${i} sed -e 's/${i}/${j}/g'... (5 Replies)
Discussion started by: new_learner
5 Replies

3. Shell Programming and Scripting

variables and sed

Is it possible to place a variable in a sed command as such? sed 's/ret_Priv()/$var/' <filename> I am doing this under Bourne. (5 Replies)
Discussion started by: plslakewood
5 Replies

4. Shell Programming and Scripting

Sed to handle newline specific name modifiication

Hi, The below link clarification required... https://www.unix.com/shell-programming-scripting/112523-sed-handle-newline-specific-name-modifiication.html Vasanth (1 Reply)
Discussion started by: vasanth_vadalur
1 Replies

5. Shell Programming and Scripting

Sed to handle newline specific name modifiication

Hi, Using sed, i need to edit two functions data as explained below. C1 function axis need to be change as axis1 and in C2 function width and height name should change as width2 and height2. Input file : c1 { width=0 text=Pen height=0 axis=no mode=6 }... (11 Replies)
Discussion started by: vasanth_vadalur
11 Replies

6. Shell Programming and Scripting

Using variables in sed

Hi, I want to append some data at end of file , so i use following sed '$a/data=$var' file But by this method i am not able to substitue value of $var, & if i use " in place of ', then $a, gives me problem. Any suggestions? -Sarbjit (4 Replies)
Discussion started by: sarbjit
4 Replies

7. Shell Programming and Scripting

Using Variables with SED

All I am trying to produce the following in /etc/ssh/sshd_config, # IPv4 only #ListenAddress 0.0.0.0 # IPv4 & IPv6 ListenAddress :: to # IPv4 only ListenAddress <user-entry> ListenAddress <user-entry> # IPv4 & IPv6 #ListenAddress :: The number of user entries can vary. ... (1 Reply)
Discussion started by: miyoung999
1 Replies

8. Shell Programming and Scripting

AWK/SED: handle max chars in a line

Hi all, I hope you guys can help me. I prefer SED/AWK solutions if possible. For my shame it didn't work for me :o ISSUE: :wall: 1\3 1/$4\@7\ 1234567890123456789\ 1234567890123456789,\ 1234567890123456789\ 123456789012 12345 1234567890123456789\ 1234567890123456789,\ 1234... (5 Replies)
Discussion started by: unknown7
5 Replies

9. UNIX for Dummies Questions & Answers

Difference between handle to the thread HANDLE and thread identifier pthread_t

This question might be silly but its confusing me a bit: What is the difference between handle to the thread HANDLE and thread identifier pthread_t? ---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ---------- Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

10. Shell Programming and Scripting

sed with variables

Im trying to use sed to print value that matches the value in variable and all lines after that. grep "Something" test.txt | sed -e '/{$variable}/,$b' -e 'd' I cant get it work, if I replace the $variable with the value it contains, it works fine... (10 Replies)
Discussion started by: olkkis
10 Replies
COROSYNC-QUORUMTOOL(8)					      System Manager's Manual					    COROSYNC-QUORUMTOOL(8)

NAME
corosync-quorumtool - Set and display quorum settings. SYNOPSIS
corosync-quorumtool [-s] [-m] [-l] [-p] [-v votes] [-n nodeid] [-e expected] [-h] [-i] [-V] DESCRIPTION
Display the current state of quorum in the cluster and set vote quorum options. OPTIONS
-s show quorum status -m constantly monitor quorum status -l list nodes -v <votes> change the number of votes for a node * -n <nodeid> optional nodeid of node for -v -e <expected> change expected votes for the cluster * -H show nodeids in hexadecimal rather than decimal -i show node IP addresses instead of the resolved name -p when used with -s or -l, generates machine parsable output -h (if no other argument) show this help text -V show version and exit * Starred items only work if votequorum is the quorum provider for corosync SEE ALSO
corosync_overview(8), votequorum_overview(8), AUTHOR
Angus Salkeld 2012-01-12 COROSYNC-QUORUMTOOL(8)
All times are GMT -4. The time now is 03:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy