Hi why don't you try it yourself? But it would be preferable to use single quotes instead of double quotes, to prevent the shell from nibbling away at the back slashes in front of some characters ( $ ` " \ and <newline> ), so sed will not see them.
produces:
Also by putting \ in front of some of the normal characters, you are introducing a special meaning:
How can I use sed to replace a ctrl character such as 'new line' (\0a) to something else? Or any other good command can do this job?
Thanks,
Hillxy (5 Replies)
Hi Friends,
Following is an output of a script
OPWQERIUTYKLSADFJHGXZNMCVBWQOPERIUTYKLSADFJHGXZNMCVB
I want to replace above string's 11 to 17 character by ******* (7 stars)
How can it be done?
Please somebody guide me. (6 Replies)
Hello,
I have a file with many lines with below format:
\abc\\1234
jkl\\567
def\\345
\pqr\\567
\xyz\\234
Here, i need to do 2 things.
1. replace \\ with \
2. remove starting \
so output to be as below: (11 Replies)
I want to append the following line to /var/spool/cron/root:
*/7 * * * * /root/'Linux CPU (EDF).sh' > /dev/null 2>&1
How to accomplish this using echo?
---------- Post updated at 04:09 PM ---------- Previous update was at 04:07 PM ----------
"Linux CPU (EDF)" is actually stored in a... (11 Replies)
I'm trying to parse out DNS logs from dozens of different domain controllers over a large period of time. The logs are rolled up into individual text files by size, which may contain only a portion of a day's activity or several day's worth (depending on amount of activity). I'm splitting them by... (4 Replies)
I tried to replace the following in vi:
old: 'e/thesis/pp/zones/zones'
new: 'd/so162/fix/pp'
For that, I used: :%s/e/thesis/pp/zones/zones/d/so162/fix/pp/g
but doesn't work, a trailing character error message appeared. How can I get it?
Thanks in advance (3 Replies)
Hi, I have a bash script and I am looking for a command that will merge specific lines together.
Sample Data:
registration time = 1300890272
Id = 1
setd = 0
tagunt = 26
tagId=6, length=8, value=
tagId=9, length=5, value=
tagId=7, length=2, value=
tagId=16, length=2, value=
tagId=32,... (8 Replies)
Hi,
I have a text file with some lines like this:
/MEDIA/DISK1/23568742.MOV
/MEDIA/DISK1/87456321.AVI
/MEDIA/DISK2/PART1/45753131.AVI
/IMPORT/44452.WAV
...
I want to remove the last 12 characters in each line that it ends "AVI". Should look like this:
/MEDIA/DISK1/23568742.MOV... (12 Replies)
Hi,
I have a text file which is output from a server and it lists all the files in a specific volume. However, the volume name appears as volume_name:.
I would like to replace this with \\volume_name\volume_name. This is not a problem in itself as I can use sed to globally look for the... (8 Replies)
Hello dears,
Please tell me how can I replace control characters with normal string. I have a file that contains normal string and ^A ^C control characters. I tried to use sed and awk without any luck.
sed 's/^A/foo/g' text > text1 //not worked
sed 's/\x01/foo/g' text > text1 ... (6 Replies)
Discussion started by: sembii
6 Replies
LEARN ABOUT PHP
htmlspecialchars_decode
HTMLSPECIALCHARS_DECODE(3) 1 HTMLSPECIALCHARS_DECODE(3)htmlspecialchars_decode - Convert special HTML entities back to charactersSYNOPSIS
string htmlspecialchars_decode (string $string, [int $flags = ENT_COMPAT | ENT_HTML401])
DESCRIPTION
This function is the opposite of htmlspecialchars(3). It converts special HTML entities back to characters.
The converted entities are: &, " (when ENT_NOQUOTES is not set), ' (when ENT_QUOTES is set), < and >.
PARAMETERS
o $string
- The string to decode.
o $flags
- A bitmask of one or more of the following flags, which specify how to handle quotes and which document type to use. The default
is ENT_COMPAT | ENT_HTML401.
Available $flags constants
+--------------+---------------------------------------------------+
|Constant Name | |
| | |
| | Description |
| | |
+--------------+---------------------------------------------------+
| | |
| ENT_COMPAT | |
| | |
| | Will convert double-quotes and leave single- |
| | quotes alone. |
| | |
| | |
| ENT_QUOTES | |
| | |
| | Will convert both double and single quotes. |
| | |
| | |
|ENT_NOQUOTES | |
| | |
| | Will leave both double and single quotes uncon- |
| | verted. |
| | |
| | |
| ENT_HTML401 | |
| | |
| | Handle code as HTML 4.01. |
| | |
| | |
| ENT_XML1 | |
| | |
| | Handle code as XML 1. |
| | |
| | |
| ENT_XHTML | |
| | |
| | Handle code as XHTML. |
| | |
| | |
| ENT_HTML5 | |
| | |
| | Handle code as HTML 5. |
| | |
+--------------+---------------------------------------------------+
RETURN VALUES
Returns the decoded string.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.4.0 | |
| | |
| | The constants ENT_HTML401, ENT_XML1, ENT_XHTML |
| | and ENT_HTML5 were added. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
A htmlspecialchars_decode(3) example
<?php
$str = "<p>this -> "</p>
";
echo htmlspecialchars_decode($str);
// note that here the quotes aren't converted
echo htmlspecialchars_decode($str, ENT_NOQUOTES);
?>
The above example will output:
<p>this -> "</p>
<p>this -> "</p>
SEE ALSO htmlspecialchars(3), html_entity_decode(3), get_html_translation_table(3).
PHP Documentation Group HTMLSPECIALCHARS_DECODE(3)