Sponsored Content
Top Forums Shell Programming and Scripting Escape Sequence Overide in XML file Post 302847383 by Don Cragun on Tuesday 27th of August 2013 12:35:18 AM
Old 08-27-2013
Quote:
Originally Posted by jimmyb
Hi Don
Thanks a lot for your reply .I have one more issue their are qoutes also how do I take care of those its like


Code:
 
sed -e "s|xmlns="123//abc/integration/"||g" Orginal.xml >output.xml

How do I handle these

---------- Post updated at 10:51 PM ---------- Previous update was at 10:43 PM ----------

I understand If I use single qoutes I will be able to handle it but I want to pass the string as a variable and when I use single qoutes it may not expand the variable
You are correct in saying that variables will not be expanded when they appear inside single quotes. Since there are no variables in your example I don't know what you're trying to do.

The sed command above will perform the same as any of the following:
Code:
sed -e "s|xmlns=123//abc/integration/||g" Orginal.xml >output.xml
sed -e 's|xmlns='123//abc/integration/'||g' Orginal.xml >output.xml
sed -e 's|xmlns=123//abc/integration/||g' Orginal.xml >output.xml
sed -e s"|"xmlns=123//abc/integration/'||'g Orginal.xml >output.xml

or several million other commands with other combinations of single and double quotes. If you will clearly describe where you want to put a variable and explain what is in the variable, we may be able to help.

If you are hoping to set a shell variable to a string matched by a pattern given in a sed substitute command, the syntax you are using is VERY strange and will not work in that form.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Escape sequence

Hi, I have got an application through which an user will submit an address like "c:\tuser\abc". This application calls a script and passes the address to the scripts positional parameter say $1. So $1 should contain "c:\tuser\abc", but when $1 is echoed the "\t" and "\a" are interpreted to... (4 Replies)
Discussion started by: puspendu
4 Replies

2. UNIX for Advanced & Expert Users

want to view the escape sequence

Hi, Is it possible to view the escape sequence in the ascii file. That is I want to see the newlinw character,tab ........ etc Thanks Sweta (4 Replies)
Discussion started by: sweta
4 Replies

3. UNIX for Dummies Questions & Answers

Both HOME and INSERT key send same escape sequence on ssh

I couldn't seem to make 'HOME' key work on my remote windows ssh client to a Fedora Core3 server (the home key works perfectly when i'm physically on site.) To my surprise, using control+V it seems that both my home and insert key send the same escape sequence ^So it must be my windows SSH client... (0 Replies)
Discussion started by: grossgermany
0 Replies

4. Shell Programming and Scripting

escape sequence for $

Hi all, I have a requirement where the variable name starts with $, like $Amd=/home/student/test/ How to work wit it? can some one help me, am in gr8 confusion:confused: (5 Replies)
Discussion started by: shreekrishnagd
5 Replies

5. Shell Programming and Scripting

Removing Escape Sequence Characters

Hi All, I have added the script command to user profile so that to record the on-screen data.But when i i checked the O/P i could see lot of escape sequence is there way to remove it. (2 Replies)
Discussion started by: cutechaps
2 Replies

6. Shell Programming and Scripting

How to achieve UTF-8 encoding & URL escape in an xml file?

Is there any i can achieve entity escaping, URL escaping & UTF-8 encoded for the xml generated through shell script? #! /bin/bash echo "<path>" >> file.xml for x in `ls filename*` do echo -e "\t<dir>" >> file.xml echo -e "\t\t<file>$x</file>" >> file.xml... (0 Replies)
Discussion started by: vel4ever
0 Replies

7. Shell Programming and Scripting

Help with escape sequence for '$' symbol in EGREP function

$table is the variable which contains name of the file. Filename may have the special character $. Need to escape $ . Tried below options to escape dollar: \$$table "\$"$table"" what is the escape sequence for egrep function..? Below is the code snippet- my $table; foreach... (3 Replies)
Discussion started by: xylus77
3 Replies

8. Red Hat

Grep doesn't understand escape sequence?

I ran the following grep and sed command. grep "\t" emp.txt sed -n '/\t/p' emp.txt grep treated the '\' as to escape t and took the pattern as literal t whereas sed took the pattern as tab. That means , grep doesn't understand escape sequence!!!!!! what to do to make grep... (8 Replies)
Discussion started by: ravisingh
8 Replies

9. Shell Programming and Scripting

Ignore escape sequence in sed

Friends, In the file i am having more then 100 lines like, File1 had the values like this: #Example East.server_01=EAST.SERVER_01 East.server_01=EAST.SERVER_01 West.server_01=WEST.SERVER_01 File2 had the values like this: #Example EAST.SERVER_01=http://yahoo.com... (3 Replies)
Discussion started by: jothi basu
3 Replies

10. UNIX for Dummies Questions & Answers

Escape sequence for Function keys - terminfo

Having a doubt on how Function keys are mapped. 1. In my HPUX box my infocmp shows that kf1 (F1 key mapping) is not mapped. But somehow I am able to use an Informix form which requires navigation using F1 keys. vt100-w|vt100-w-am|dec vt100 132 cols (w/advanced video), bce, bw, ccc,... (3 Replies)
Discussion started by: clemansy
3 Replies
Net::EPP::Frame::Command::Check::Domain(3pm)		User Contributed Perl Documentation	      Net::EPP::Frame::Command::Check::Domain(3pm)

NAME
Net::EPP::Frame::Command::Check::Domain - an instance of Net::EPP::Frame::Command::Check for domain names. SYNOPSIS
use Net::EPP::Frame::Command::Check::Domain; use strict; my $check = Net::EPP::Frame::Command::Check::Domain->new; $check->addDomain('example-1.tld'); $check->addDomain('example-2.tld'); $check->addDomain('example-2.tld'); print $check->toString(1); This results in an XML document like this: <?xml version="1.0" encoding="UTF-8"?> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> <command> <check> <domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd"> <domain:name>example-1.tldE<lt>/domain:name> <domain:name>example-2.tldE<lt>/domain:name> <domain:name>example-3.tldE<lt>/domain:name> </domain:check> </check> <clTRID>0cf1b8f7e14547d26f03b7641660c641d9e79f45</clTRIDE<gt> </command> </epp> OBJECT HIERARCHY
L<XML::LibXML::Node> +----L<XML::LibXML::Document> +----L<Net::EPP::Frame> +----L<Net::EPP::Frame::Command> +----L<Net::EPP::Frame::Command::Check> +----L<Net::EPP::Frame::Command::Check::Domain> METHODS
$frame->addDomain($domain_name); This adds a domain name to the list of domains to be checked. AUTHOR
CentralNic Ltd (http://www.centralnic.com/). COPYRIGHT
This module is (c) 2012 CentralNic Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
o Net::EPP::Frame perl v5.14.2 2012-04-23 Net::EPP::Frame::Command::Check::Domain(3pm)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy