02-29-2008
then, you need to see how to read it into k by escaping the $. can you tell us how you are reading it from the file and assigning to k ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My String variable is holding value as - abc"def
I want to replce " with \"
I tried with awk :
echo $var | awk '{gsub(/"/,"\"");print}'
and I am getting an error, `)' is not expected. (1 Reply)
Discussion started by: videsh77
1 Replies
2. Shell Programming and Scripting
I need to replace anything immediately after the pattern "standard01/" in a file with the value of a variable
I don't know the length of the characters stored in that variable. - that might vary.
I know there is some string after the pattern "standard01/", i don't know the what the string is or... (1 Reply)
Discussion started by: prekida
1 Replies
3. Shell Programming and Scripting
Input file - tmp
<begin>
./00003/
./00004/
<end>
I would like to replace "." with the value of pwd
so that the output will look like
/dev/project/00003/
t=`pwd`
sed -e "s/\./$t/g" tmp > tmp1;
The above piece of code is not working. Appreciate your help. (4 Replies)
Discussion started by: lotto_123
4 Replies
4. Shell Programming and Scripting
ip1="xxx"
ip2="bbb"
sed 's/$ip1/$ip2/g' (3 Replies)
Discussion started by: shivarajM
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
If I have a variable
var1 ='TH 12/1234'
How can I set this too in a script
var1 ='TH 12~1234'
Bearing in mind "/" might be in a difference place each time and that the "/" might not even exist each time
the variable is set.
Thanks (3 Replies)
Discussion started by: belfastbelle
3 Replies
6. Shell Programming and Scripting
All I want to do is replace the 2nd line in a file with a variable, eg,
var=xxx
the file 'test' containing:
aaa
bbb
ccc
replace bbb with xxx
aaa
xxx
ccc
I had it working with sed on a redhat machine, but it doesn't work on a mac machine. (4 Replies)
Discussion started by: sideways
4 Replies
7. Shell Programming and Scripting
Hi guys
In my shell script I have a variable that contains a string that contains the current time.
I want to replace the spaces and colons in the value with underscores.
TIME=`date`
echo $TIME
gives me: Thu Sep 24 16:40:53 BST 2009
I want it to show:... (4 Replies)
Discussion started by: alinaqvi90
4 Replies
8. Shell Programming and Scripting
Hi,
I've a variable for example..
ACTIVATION_DATE=2010-11-11
(the date above is a result of a sql query and not hardcoded)
now there is another file (test_2.parm) where there are many variables predefined..
REG_CODE=111
ACT_DATE=2010-10-10
CAN_DATE=8888-31-12
Now I want to search for... (1 Reply)
Discussion started by: RRVARMA
1 Replies
9. Shell Programming and Scripting
Hi all,
I have a script in file1 which gets input from the user say variable "TYPE". This variable is present in the other file2. I want to replace the variable in the file2 with the value given by the user and print the file. How can I achieve this task?
file1
code
echo "Give... (3 Replies)
Discussion started by: Ananthdoss
3 Replies
10. Shell Programming and Scripting
input.txt
I want to make 3 seprate ouputs such that
toast1.txt
ICH.txt
ICH_SV.txt
I have tried "echo" and "sed 's/k/toast1/g' to replace k, but its not quite working. Please help me out :)
Thanks! (4 Replies)
Discussion started by: johnkim0806
4 Replies
LEARN ABOUT DEBIAN
html::mason::escapes
HTML::Mason::Escapes(3pm) User Contributed Perl Documentation HTML::Mason::Escapes(3pm)
NAME
HTML::Mason::Escapes - Functions to escape text for Mason
DESCRIPTION
This module contains functions for implementing Mason's substitution escaping feature. These functions may also be called directly.
html_entities_escape
This function takes a scalar reference and HTML-escapes it using the "HTML::Entities" module. By default, this module assumes that the
string it is escaping is in ISO-8859-1 (pre Perl 5.8.0) or UTF-8 (Perl 5.8.0 onwards). If this is not the case for your data, you will
want to override this escape to do the right thing for your encoding. See the section on User-defined Escapes in the Developer's
Manual for more details on how to do this.
url_escape
This takes a scalar reference and replaces any text it contains matching "[^a-zA-Z0-9_.-]" with the URL-escaped equivalent, a percent
sign (%) followed by the hexadecimal number of that character.
basic_html_escape
This function takes a scalar reference and HTML-escapes it, escaping the following characters: '&', '>', '<', and '"'.
It is provided for those who wish to use it to replace (or supplement) the existing 'h' escape flag, via the Interpreter's
"set_escape()" method.
This function is provided in order to allow people to return the HTML escaping behavior in 1.0x. However, this behavior presents a
potential security risk of allowing cross-site scripting attacks. HTML escaping should always be done based on the character set a
page is in. Merely escaping the four characters mentioned above is not sufficient. The quick summary of why is that for some
character sets, characters other than '<' may be interpreted as a "less than" sign, meaning that just filtering '<' and '>' will not
stop all cross-site scripting attacks. See http://www.megasecurity.org/Info/cross-site_scripting.txt for more details.
perl v5.14.2 2012-02-04 HTML::Mason::Escapes(3pm)