General :: Replace New Line With <br /> And Escape Special Characters?

Feb 6, 2011

I wish to replace a new line with br (html) but it doesn't seem to work

Code:

message=$(echo ${FORM_message} | tr '
' '<br />' )

what it gives me seems to be ... b...? I am also having problem escaping hash sign in cut command:

Code:

list=$(echo "$line" | cut -d'#;#' -f1) ;

my intention is to split the line with "#;#"

View 5 Replies


ADVERTISEMENT

General :: Using Sed To Replace String With Special Characters In XML File?

Apr 29, 2011

I am having difficulty getting sed to replace a string of text in an XML file, despite the fact that I have no trouble using grep to find that same string. Since the new string and old string to be replaced contain a lot of special characters, I thought it best to store them in variables as opposed to using a slew of backslashes:

OLD_STRING='<property name="webServiceHost">${jboss.bind.address}</property>'
NEW_STRING='<!--<property name="webServiceHost">${jboss.bind.address}</property>-->'

[Code]....

View 2 Replies View Related

General :: Search And Replace String Having Multiple Special Characters

Aug 26, 2009

Below is extract of my file:

What I need is to replace "--destination-path=" with "--destination-path=/home/dest"

i.e. desired output is ----destination-path=/home/dest

I could achieve it with below command

$cat outgoing-xfer|grep destination-path|perl -pi -e "s/destination-path=/destination-path=/home/dest/g"

But the problem is that in this case i just wanted to append "/home/dest" for which I could easily escape "/" with just two "", but I wonder if i have a long path like "/a/b/c/d/e/f/g/h/i/j" I will have to escape so many /. Is there any other way by which I can avoid escaping forward slash.

I tried following:

But receiving follo error

Bareword found where operator expected at -e line 1, near "s/destination-path=/'destination-path=/home"
syntax error at -e line 1, near "s/destination-path=/'destination-path=/home"
Bad name after dest' at -e line 1. tried with enclosing in double quotes as well but in vain

View 5 Replies View Related

Ubuntu :: Replace Strings Containing Special Characters With Sed?

Jan 4, 2011

here's my newbie question - I want to change the following string in text files

Code:
E:MP3
with the following string using sed:

[code]....

View 3 Replies View Related

Software :: Using Sed To Replace Special Characters In A File?

Mar 24, 2011

I have a file with special characters that need to be replaced. I've been working on this for a day and have run out of time.

Example: FILE='/var/tmp/S0000000.LOG.March-24-2011:10:51.tar'

Need to replace the ' with a " on all lines in the file.

View 2 Replies View Related

General :: Bash : Pass Command Line Arguments Containing Special Characters?

Jul 14, 2010

I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program(there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]".Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.?

(Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)

View 7 Replies View Related

General :: Bash: How To Pass Command Line Arguments Containing Special Characters

Jun 24, 2011

I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program (there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]". Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.? (Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)

View 8 Replies View Related

General :: Does Non-printing Characters Escape Characters Still Needed For PS1 Definition?

Aug 28, 2011

While modifying the definition of my PS1, I saw that "[" and "]" markers should be added to help bash to compute the right display lenght. Many exemples on the web do not use them or even mention them.I searched for a solution to add them automatically, like with sed, but I didn't find any example.Are they still needed and is there a recommandation not to use sed to define PS1?

View 1 Replies View Related

Programming :: Change A Line In A File Code - Sed Special Characters Bash Script

Jan 26, 2011

I'm having issue when trying to change a line in a file

[Code]....

View 1 Replies View Related

General :: Escape Characters In Watch Command

Oct 20, 2009

Need little advice running this command.
watch -d 'ps aux | awk '{print $4" "$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr | head'

I get this error message from AWK. awk: cmd. line:1:
{print awk: cmd. line:1: ^ unexpected newline or end of string

I have tried all the usual by trying to escape the single and double quotes in the command but same result. The end result should be the a listing of memory hungry processes that are scanned every 2 seconds (watch default value).

View 2 Replies View Related

General :: Removing The Escape Characters From GNU Screen's Screenlog.%n?

Jan 22, 2010

Is it possible to remove the ESC sequences in GNU Screen's output file? Things such as colours, tabs and other escape characters make their way into the log files and become difficult to decipher.

I've tried Dr. Google & Co. as well as reading the manual, but haven't been able to find anything suitable.Perhaps I've overlooked something?

View 3 Replies View Related

General :: Convert Shell Logs - Incl. Escape Characters - To HTML?

Mar 6, 2010

Is there tool or a regexp that can convert shell escape characters to HTML code?

As an example, here is a logfile from GNU screen:

Which I would like to convert to something like this:

And send as HTML e-mail to an e-mail address, to archive my work.

Here is a related question, which shows how to convert it to regular text, but it would be nice to convert to HTML and not just throw the escape characters away.

View 1 Replies View Related

General :: $@ >> File With Special Characters?

May 21, 2010

Simple logging script that allows user to enter quick notes and questions, but I can not get it to pass punctuation '?. no matter what I type after 'n' i need that to be inserted at the end of the working project note file.Any help and working examples would be appreciated, but please also direct me to the proper reading material so I can learn something - not looking for someone to just do it for me.usage:

Code:
bob@smith:~/notes$ n bob's script sucks?
>

[code]....

View 14 Replies View Related

General :: Write Special Characters In UTF-8?

May 25, 2011

I want to be able to enter special characters into OOWriter and gedit. Ubuntu supports UTF-8, and I've no idea how to use it.

View 1 Replies View Related

General :: Special Characters Don't Appear In GNOME

Jan 21, 2011

I am trying to make specifically Norwegian characters appear properly. Right now they look like this:

[URL]

Characters like turns the same. This is a font that I downloaded called PT Sans. The letters I want are included, they just don't appear right in the GNOME environment, it seems. They work just fine in other applications, such as OOo Writer. I'm using Ubuntu 10.04.

View 7 Replies View Related

General :: Using Find And Tar With Files With Special Characters In The Name?

Jun 1, 2010

I want to archive all .ctl files in a folder, recursively.tar -cf ctlfiles.tar `find /home/db -name "*.ctl" -print`The error message :tar: Removing leading `/' from member namestar: /home/db/dunn/j: Cannot stat: No such file or directorytar: 74.ctl: Cannot stat:No such file or directoryI have these files: /home/db/dunn/j 74.ctl and j 75. Notice the extra space. What if the files have other special characters? How do I archive these files recursively?

View 2 Replies View Related

General :: Write Special Characters (like |, ~, Alt, +, 124 In Windows)?

Apr 15, 2009

I've always been connecting to linux machine from windows computer, using putty.

Now the situation changed and I have a question:

How the hell can I write special characters (like | ~ Alt + 124 in Windows)?

View 4 Replies View Related

General :: KDE - File Names With Special Characters ?

Feb 20, 2010

I am running gentoo openbox(rox file manager and desktop) I installed Digikam and Amarok. But I have problems with files which include special character in their names(such as �,�, �,ğ... ) The files are shown with strange and weird characters in the file dialogs of Digikam and Amarok.

I don't have this problem in other applications. I can create files with special character included. I think some settings do not agree with KDE4. How can I solve this problem? Does anyone have an idea? I also installed KDE systemsettings program but could not find a relevant config option for character encoding.

View 2 Replies View Related

General :: Special Characters In PDF Creation With PHP On Suse?

Apr 13, 2011

We are creating PDFs from different sources using PHP, Zend_PDF class and Zend server (based on apache2). Developping on windows the PDFs are OK. If we deploy the application on testing server running SuseLinux the special characters ( ) don't show. We use 1 of the standard fonts, HELVETICA and have tested without success COURIER.

The system

Do you have an idea what to do or try?

OK - it turned out to be a coding question. I had thought that some system variable might cause the problem but we simply had to clean the input data and got it working.

View 1 Replies View Related

General :: GREP - Search Special Characters

Feb 10, 2010

I need to search for the following pattern with GREP in a text file:

So I tried already:

But none of those works...I think probably because GREP doens't like the special character > in the middle of the serach pattern.

At the end I just need to now if GREP found the pattern in the file or not, so it should give me a 0 or a 1 back, once I check the value of the variable "?" after using the grep command.

View 4 Replies View Related

General :: Tar Fails To Extract Archive Containing Special Characters?

Jun 5, 2011

The command tar -xvf wpa_tables.tar gives this error

tar: ./xai-0/334Regency: Cannot open: Invalid or incomplete multibyte or wide character
tar: Exiting with failure status due to previous errors

Obviously the backslash is giving tar some problem, but I've been all over the docs and can't figure out how to either make it skip this file or interpret the character literally. Here's my command history to show some of the options I've tried which don't work.

tar --no-wildcards -xkvf wpa_tables.tar
tar --exclude ./xai-0/\334Regency -xkvf wpa_tables.tar
tar --exclude "./xai-0/\334Regency" -xkvf wpa_tables.tar
tar --ignore-command-error -xkvf wpa_tables.tar
tar --ignore-failed-read -xkvf wpa_tables.tar
tar --transform 's/\/slash/g' -xvf wpa_tables.tar ./xai-0/\334Regency

I'm totally out of ideas at this point and would welcome some input from more experienced members.

View 1 Replies View Related

General :: Rsync On Windows To Make It Keep Special Characters In File-names

Sep 2, 2010

We're in the process of implementing an offsite backup of all our servers to a remote Linux server. We're using rsync over ssh.What I've found is that characters such as ±, ¶,´ and £ are replaced on the Linux server with underscores.I don't mind if it changes these characters in the filenames of documents, but when it renames a language pack from Espa±ol.clx to Espa_ol.clx, it could cause issues for us further down the line.

What do I need to do differently to make the special characters copy over correctly? For the initial sync which will take place locally, before the machine is moved offsite, I have SAMBA enabled. I am able to copy files from Windows to the Samba share, retaining the original filename, though it looks different in the Linux directory listing, i.e. t̻st becomes ĻstThese files get deleted by rsync when it runs, as it does not match the filenames.

View 1 Replies View Related

General :: Include Special Characters When Sorting Files By Name (Fedora 12 I386)?

Feb 15, 2010

I am dragging my files over to a new Fedora 12 installation and I just noticed that special characters are not taken into account when sorting files by name (I want '_js' to come before 'images').Is there a way to make the sorting process behave like Windows, where files starting with a special character are listed first?

View 5 Replies View Related

Programming :: Escape Characters In System?

Nov 11, 2010

My goal is to send escape characters from Linux to make scanner's LED blink. I've started with a simple "beep" command:
echo -e "�7"

and it worked. We are using WaveLink emulator and the escape sequences for the LED are
echo -e "�33%150;200;5L"

Linux returns me this: 150;200;5L
So, it doesn't work. What am I doing wrong for the LED sequences?

View 1 Replies View Related

General :: Replace Characters In Txt File?

Nov 7, 2010

I have txt file with list of ID's and I need to insert comma in every line and then remove new line character so it'll become one long string. So to clarify, I have txt file content that looks like this.

234
5466
2356
... and so on.

but I would like this to change to 234,5466,2356,... I looked at sed and tried to wrap my head around the commands but I guess my brain isn't smart enough. its really confusing for me. I've managed to add commas to end of line (sed "s/$/,/g" filename) but somehow I can't seem to remove new line character from each line.

sed 's/[

]*$//' doesn't seem to work.

View 4 Replies View Related

Software :: Vim To Render Terminal Colouring Using Escape Characters?

Nov 2, 2010

My question is: what option can I set in vim to see the colouring inside the editor as I would get it in my terminal (and switch off any additional syntax highlighting)?

View 1 Replies View Related

General :: Sort By Line Size (number Of Characters In A Line)?

Jan 8, 2010

I want to sort a number of lines based on their size:

data:
-------
12345678
87654321
1234

[code]....

Should output as:
-----------------
1
2
12
21

[code]....

But i'm gettings this with sort
----------------
1
12
123
1234

[code]....

Can we sort the above "data" text, based on "number of characters" instead of "character order"?

View 8 Replies View Related

Slackware :: Dhclient Does Not Strip Or Escape Shell Meta-characters

Apr 6, 2011

dhclient does not strip or escape shell meta-characters

Summary: dhclient doesn't strip or escape certain shell meta-characters in dhcpd responses, allowing a rogue server or party with with escalated privileges on the server to cause remote code execution on the client.

CVE:

ISC dhclient did not strip or escape certain shell meta-characters in responses from the dhcp server (like hostname) before passing the responses on to dhclient-script. Depending on the script and OS, this can result in execution of exploit code on the client.

CVSS Score:

For more information on CVSS scores, visit [url]

Workarounds:

On SUSE systems, it is possible to disable hostname update by setting DHCLIENT_SET_HOSTNAME="no" in /etc/sysconfig/network/dhcp.

Other systems may add following line to dhclient-script at the beginning of the set_hostname() function:

In environments where filters/acls can be put into place to limit clients to accessing only legitimate dhcp servers, this will protect clients from rogue dhcp servers deliberately trying to exploit this bug.

However, this will not protect from compromised servers.

Active exploits:

Solution:

Upgrade to 3.1-ESV-R1, 4.1-ESV-R2 or 4.2.1-P1. [url]

No patch is available for 4.0.x as it is EOL. Anyone running 4.1.x should upgrade to 4.1-ESV-R2.

Acknowledgments:

Revisions:

View 1 Replies View Related

Ubuntu :: KDE 4.4 - Compose Key And Special Characters

Feb 15, 2010

I am trying to type German Umlaut letters on an English keyboard using kde 4.4. For some reason I seem unable to figure out how to do that (I have just recently switched to kde, was using gnome before). I have looked through various threads and the kubuntu wiki [URL], but can't get the compose key to work. In gnome I used to type "AltGr" plus "[" followed by a vowel and thus get my Umlaut - before I fiddled with the system settings this worked in kde, but only in firefox & Open Office (I assume they are gtk apps).

Since it did not work in Kmail, I went to the system settings, set up a ComposeKey (AltGr, but also tried rightWin), but it doesn't change anything for the kde applications. It only means that the old key-combination now stopped working in firefox and OO. In the system setting of kde 4.4 I can't see the options to enable xkb-options, but I assume the advanced options of the keyboard layout are xkb-options of previous kde releases. I unticked the box 'reset old options', but nothing changed. I type a lot of German text, so using a character map is not an option.

View 2 Replies View Related

General :: Replace Line With Another Line In Shell Script?

Feb 26, 2010

I have the file abc.txt

cat abc.txt This is a test file Nothing is new in this world

I want to replace "This is a test file" to "Text is replaced"

Code:
FindString='This is a test file'
ReplaceString='Text is replaced'
Findarray=(`echo $FindString | tr ' ' ' '`)

[Code]....

But this is not effective. how to replace entire line either using sed or awk or any other utility.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved