02-21-2006
How to replace a word with a series of words in a file
Hi,
I have a Template file 'TL.body' which says as follows:
"There are no <FILENAME> files on the server. "
The missing file names are identified and stored in a variable.
For Eg: MISSFILE="abc.txt def.txt xyz.txt"
I want the values of MISSFILE variable to be replaced against <FILENAME> and store the result in another Temp file.
I tried using the following command:
sed 's/<FILENAME>/'$MISSFILE'/g' TL.body > Temp.txt
However, it gives following error:
sed: Function s/<FILENAME>/abc.txt cannot be parsed.
Could somebody help me out to overcome this problem.
TIA
Regards,
Ramesh
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
lets see if i can explain this in a good way.
im trying to replace some words in a file but i need to know what the words are that is beeing replaced. not sure if sed can do this.
file.name.something.1DATA01.something.whatever
sed "s/./.DATA?????/g"
need to know what the first . is... (2 Replies)
Discussion started by: cas
2 Replies
2. Shell Programming and Scripting
Hi,
I want to replace a word in a file which occurs after a particular word.
For example :
$cat file.txt
CASE
WHEN
AND c1 = 'I'
AND c2= '2'
THEN 1
WHEN
AND c1= 'I'
AND c2= '0'
THEN 2
So in this example i want to replace... (4 Replies)
Discussion started by: ashwin3086
4 Replies
3. Shell Programming and Scripting
hello,
i 'd like your help about a bash script which:
1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel,
2.finds the link which leads to the download location of the Latest Stable Kernel version,
(the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I would like to change my setting in a file to the setting that user input.
For example, by default it is
ONBOOT=ON
When user key in "YES", it would be
ONBOOT=YES
--------------
This code only adds in the entire user input, but didn't replace it.
How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies
5. Shell Programming and Scripting
My file has the entries like below...
/dev/sds
/dev/sdak
/dev/sdbc
/dev/sdbu
I want to make the file like below
echo 1 > /sys/block/sds/device/rescan
echo 1 > /sys/block/sdak/device/rescan
echo 1 > /sys/block/sdbc/device/rescan
echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies
6. Shell Programming and Scripting
Hi Guys,
I have a text where we used Ram in 10 times now I want replace all Ram words by Shyam word then how to do it. (6 Replies)
Discussion started by: aaditya321
6 Replies
7. Shell Programming and Scripting
I have the file like this.
cat 123.txt
<p> <table border='1' width='90%' align='center' summary='Script output'> <tr><td>text </td> </tr> </table> </p>
I want to replace some tags and want the output like below. I tried with awk & sed commands. But no luck. Could someone help me on this?
... (4 Replies)
Discussion started by: thomasraj87
4 Replies
8. Shell Programming and Scripting
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
9. UNIX for Beginners Questions & Answers
I have file1 and file2 as shown below,
file1:
((org14/1-131541:0.11535,((org29/1-131541:0.00055,org7/1-131541:0.00055)1.000:0.10112,((org17/1-131541:0.07344,(org23/1-131541:0.07426,((org10/1-131541:0.00201,org22/1-131541:0.00243)1.000:0.02451,
file2:
org14=india
org29=america... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies
10. Shell Programming and Scripting
United States 1.2.3.4 80 10 1563790914 1 1932454179 1.2.3.6 55517 11.1.2.1 55517
Italy 1.2.3.4 80 10 1563790914 1 1932454179 1.2.3.6 55517 11.1.2.1 55517
India 1.2.3.4 80 10 1563790914 1 1932454179 1.2.3.6 55517 11.1.2.1 55517
south Africa 1.2.3.4 80 10 1563790914 1... (9 Replies)
Discussion started by: arm
9 Replies
LEARN ABOUT DEBIAN
template::declare::tagset::rdf::em
Template::Declare::TagSet::RDF::EM(3pm) User Contributed Perl Documentation Template::Declare::TagSet::RDF::EM(3pm)
NAME
Template::Declare::TagSet::RDF::EM - Template::Declare TAG set for Mozilla's em-rdf
SYNOPSIS
# normal use on the user side:
use base 'Template::Declare';
use Template::Declare::Tags 'RDF::EM' => { namespace => 'em' }, 'RDF';
template foo => sub {
RDF {
attr {
'xmlns' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
'xmlns:em' => 'http://www.mozilla.org/2004/em-rdf#'
}
Description {
attr { about => 'urn:mozilla:install-manifest' }
em::id { 'foo@bar.com' }
em::version { '1.2.0' }
em::type { '2' }
em::creator { 'Agent Zhang' }
}
}
};
DESCRIPTION
Template::Declare::TagSet::RDF::EM defines a full set of Mozilla EM-RDF tags for use in Template::Declare templates. You generally won't
use this module directly, but will load it via:
use Template::Declare::Tags 'RDF::EM';
METHODS
new( PARAMS )
my $html_tag_set = Template::Declare::TagSet->new({
package => 'EmRDF',
namespace => 'em-rdf',
});
Constructor inherited from Template::Declare::TagSet.
get_tag_list
my $list = $tag_set->get_tag_list();
Returns an array ref of all the RDF tags defined by Template::Declare::TagSet::RDF. Here is the complete list:
"aboutURL"
"contributor"
"creator"
"description"
"developer"
"file"
"hidden"
"homepageURL"
"iconURL"
"id"
"locale"
"localized"
"maxVersion"
"minVersion"
"name"
"optionsURL"
"package"
"requires"
"skin"
"targetApplication"
"targetPlatform"
"translator"
"type"
"updateURL"
"version"
This list may be not exhaustive; if you find some important missing ones, please let us know. :)
AUTHOR
Agent Zhang <agentzh@yahoo.cn>
SEE ALSO
Template::Declare::TagSet, Template::Declare::TagSet::RDF, Template::Declare::TagSet::XUL, Template::Declare::Tags, Template::Declare.
perl v5.10.1 2010-12-08 Template::Declare::TagSet::RDF::EM(3pm)