The inode thing is exactly what I've always done in this situtation. But I just thought I'd have a play about and see if I could find another answer, and there's this approach too (which might be handier if you need to script this on a regular basis, for some really weird reason).
On up-to-date Bash on modern Linux, you can use a regex like this:
[^[:print:]]
to match non-printable characters only. I created a file with the same name as yours, and some other besides, and here's a sample session showing that regex in action.
So if you absolutely needed to automate the removal of such things, this might be a useful approach if your shell and/or distro support it.
I want to replace a string which contains "/" in vi but what is the escape character for forward slash?
e.g. I have a text file with the contents below and I want to replace "/Top/Sub/Sub1" with "ABC".
/Top/Sub/Sub1
The replace command I am using is ... (4 Replies)
Hi
I'm trying to split a dir listing
eg
/home/foo1/foo2
I'm using ksh
I've tried
dir=/home/foo1/foo2
splitit=`echo $dir | awk -F '\/' '{print $1}'`
echo $splitit
nothing is output!
I have checked the escape character. The only one I have found is \
BTW `pwd` | awk -F \/... (8 Replies)
Hi ,
I want to change space to ' in my script.
I tried doing this,
sed 's/ /\'/g' filename
but i could not get it.
can some one help me please.
Thanks,
Deepak (4 Replies)
Hello,
I wanted to display command with echo like this in tcsh.
output should be "//'test.test1.test2'"
(" at both ends also required in output)
Please help me. (1 Reply)
Hi All,
How do i write in sed for the 6th and 7th field of etc/passwd file as it involves "/" character?
Does mine below is correct? It's incomplete script as i need help with syntax as i always getting may errors :(
Example of etc/passwd file:
blah:x:1055:600:blah... (6 Replies)
All ,
i have input line as below .
abc\ , ewioweioi \,
and want the output as below removing the "\"
abc , ewioweioi ,
could anyone help me out (2 Replies)
i have string as below
str=".<date>"
in which i need to replace < with /< , when i tried with sed , got the output.
--> echo $str | sed 's/</\\</g'
.\<date>
when i tried to assign it to a variable , i am not getting the same
--> a=`echo $str | sed 's/</\\</g'` ; echo $a... (4 Replies)
friends,
I have a situation where i am using a $RANDOM function along with the filename, I want this to be escaped by the OS in the first assignment (works as expected) and executed in the second assignment (does not execute $RANDOM)
filename1=filename1_\$RANDOM
echo $filename1... (3 Replies)
Hi ,
I am looking for a function which will do the following.
1. I have a variable which will hold few special chracter like
SPECIAL_CHARS="& ;"2. I have an escape character.
ESCAPE_CHAR="\"3. Now when I passed some string in the function it will return the same string but now it will... (8 Replies)
Discussion started by: Anupam_Halder
8 Replies
LEARN ABOUT DEBIAN
hxunent
HXUNENT(1) HTML-XML-utils HXUNENT(1)NAME
hxunent - replace HTML predefined character entities by UTF-8
SYNOPSIS
hxunent [ -b ] [ -f ] [ file ]
DESCRIPTION
The hxunent command reads the file (or standard input) and copies it to standard output with &-entities by their equivalent character
(encoded as UTF-8). E.g., " is replaced by " and < is replaced by <.
OPTIONS
The following options are supported:
-b The five builtin entities of XML (< > " ' &) are not replaced but copied unchanged. This is necessary if the
output has to be valid XML or SGML.
-f This option changes how unknown entities or lone ampersands are handled. Normally they are copied unchanged, but this option
tries to "fix" them by replacing ampersands by &. Often such stray ampersands are the result of copy and paste of URLs into a
document and then this option indeed fixes them and makes the document valid.
DIAGNOSTICS
The program's exit value is 0 if all went well, otherwise:
1 The input couldn't be read (file not found, file not readable...)
2 Wrong command line arguments.
SEE ALSO asc2xml(1), xml2asc(1), UTF-8 (RFC 2279)
BUGS
The program assumes entities are as defined by HTML. It doesn't read a document's DTD to find the actual definitions in use in a document.
With -f, it will even remove all entities that are not HTML entities.
6.x 10 Jul 2011 HXUNENT(1)