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


ADVERTISEMENT

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 :: 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 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

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

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

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 :: Delete All ASCII Characters In File - Leave Chinese Characters Only

Jul 8, 2011

What command could I use in terminal to delete all ASCII characters? That is, delete a-z, A-Z, 0-9, and all punctuation? I have a file containing Chinese characters, and I want to remove everything else and leave just the Chinese.

I can use grep to leave only the lines that have Chinese in them, but this still leaves a lot of non-Chinese stuff on those lines. Does anyone know how I could actually remove everything that isn't Chinese?

View 4 Replies View Related

Programming :: Printing Unicode Characters In C

Sep 5, 2009

Say I want to write some of the more exotic Unicode characters to a file, what's the proper way to do it? when decimal integers are involved, we use %d for floating point we use %f and for hex we use %p.What's the equivalent marker for Unicode values that C understands?

View 3 Replies View Related

OpenSUSE :: UTF-8 Characters On Vi / Can't Handle Those Characters Properly

Jun 16, 2010

I have my OpenSuse 11.1 box set up with utf-8, however, every time I try to open a file with utf-8 characters with vi it can't handle those characters properly.

View 6 Replies View Related

General :: Printing Transcript With Ansi Escape Sequence?

Aug 8, 2010

Is there a way to print a transcript generated using script that is coloured using ansi escape sequences while preserving the colours?

I am on OS X 10.6, but any tool that works on OS X or on Linux that can print or create a pdf file will be extremely helpful.

View 1 Replies View Related

General :: Why Does VNC Eat Certain Characters?

Dec 29, 2010

I often use VNC to connect to my desktop upstairs using a laptop downstairs over my home network. I tunnel the VNC connection via SSH. The problem I keep running into is that I'll attempt to type a ! or a : or even a captial A and it will come across the wire as a 1, ;, or a respectively. Is this something I can fix? It's really REALLY annoying while one is programming to have to pop open character map and find a colon and copy/paste it in each time. Running Ubuntu 10.04 upstairs, Linux Mint 10 downstairs.

View 1 Replies View Related

General :: How To Exclude Last Several Characters?

Aug 17, 2010

any tips from you guys on how to filter my awk output?I want to exclude last 5 characters using awk in my tcpdump result.I don't want to include ".443:" in my tcpdump using awk.

View 6 Replies View Related

General :: How To Put Some Characters On The End Of A Line

Nov 1, 2010

We have a list of cyclones in the world. Now i got to check whether or not the second field is more than 1000 mm. If so, than the line has to have a[*] at the end of the line. For exemple:

Australia:1411:55.55:Mackay Cyclone 1918:1918:Mackay
to
Australia:1411:55.55:Mackay Cyclone 1918:1918:Mackay[*]

I also have to use a substitute. So far i've got this but it fails, 6,$s/([0-9])111:1/.* [*]

View 7 Replies View Related

General :: Characters For Usernames

Nov 4, 2010

How many characters does Linux recognize on usernames?

View 2 Replies View Related

General :: Keep Last 'n' Characters Of A Specified Field?

Apr 4, 2010

The input file consists of several fields. The first field is always five or more characters long. I want to keep the last five characters of the first field.

Example:
If the input file record is FEDERAL PACIFIC ELECTRIC PRODUCTS then I want to keep DERAL I can do this in four steps by using C, REV, C, and REV again but that seems like doing an easy thing the hard way. Is there a straightforward way to achieve this result with C or some other command?

View 14 Replies View Related

General :: Get The Lines With Only Five Characters?

Nov 2, 2010

I have a file with a random word on each line (3k+ lines). How can I get the lines with only five characters? I tried using grep file | more, but it returns all the words (even those less than 5 characters).

Edit: I also tried grep '.{5}' file | more but it doesn't show anything. And grep '.{5}' file | more returns all lines with four or more characters (I'm really confused about why it's doing this).

View 4 Replies View Related

General :: Sed - Match Even Characters Only?

Sep 3, 2010

Say I had a string like so

Let's say I only wanted to grab TAC and BDX the ones in the 2nd, 4th, and 6th spot.

Will grab the lines from the rest of the file assuming these are the only lines with capital letters at the very beginning of each line.

Will delete the first 'T'. What I want to do is learn how to just pick the even characters, T(T)A(A)C(C) & B(B)D(D)X(X).

Is there something like the {1} which can pick just the even or odd character matches?

View 3 Replies View Related

General :: Add Characters To Several Lines In A File?

Apr 17, 2009

I would like to modify the content of a text file in Linux, in the following way:=> the file has several of these lines:./run_pest3 ./g134366.04080_0.062 x 2_d043 1 0.43 results_EC=> I want to modify all lines to be:./run_pest3 ./g134366.04080_0.062 x 2_d043 1 0.43 results_EC0.062i.e., the last number of $2 should be "attached" to the end of $7, for each line.

View 5 Replies View Related

General :: Remapping Characters In Xmodmap?

Jun 9, 2010

I am using a Swedish keyboard, and I want to be able to type braces easier.

I planned to map AltGr + to '}' and AltGr + to '{'. However, nothing really changes. I have some other stuff in my .Xmodmap so I know that it gets loaded allright. Here's what I have so far:

keycode 35 = slash asciitilde dead_ogonek section dead_ogonek section
keycode 49 = asciicircum onehalf
keycode 66 = F10
clear Lock

[Code]....

View 1 Replies View Related

General :: Moving Characters To The End Of Line (EOL) With SED?

Sep 13, 2010

Any time the word The appears at the beginning of a line, I want to move it to the end of the line and capitalize the new first word in the line. For example, The heaven becomes Heaven the. I'm trying to test this out for my Library.

View 2 Replies View Related

General :: 8 Characters Limit In Iso File

Jul 20, 2010

I have a problem with both genisoimage and mkisofs. Both of them are limited to 8 characters. There are very many options for them. Which one would remedy the issue?

View 3 Replies View Related

General :: Scp Command And Internaltion Characters

Feb 20, 2010

When I upload a file usind the scp that contains the German characters these characters get changed to . For example, a sentence in an html file like this

looks like this

Why are this characters getting changed?

View 6 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 :: How To Ignore Hidden Characters

Nov 3, 2010

I'm trying to look at a file and find 6 or more consecutive consonants (everything except a vowel). However I have a hidden $ character at the end of each line in the file. For some reason I can't reference to it in any of the pattern searching commands.

For example: grep '[^aeiouAEIOU$]{6,}' file| more

This command returns words that contain 5 consonants at the end (because it interprets the hidden $ as not a vowel). How can I make it ignore the hidden character? Or more specifically how do I refer to the hidden character in my pattern searches?

View 5 Replies View Related

General :: Map Characters To Chosen Hotkeys?

Jan 13, 2011

I would like to map characters to chosen hotkeys.
for example, I'd like Alt Gr + a to output �.
How do i do that?

I'm using Gnome 2.30.2 on Slackware 13.1

View 2 Replies View Related

General :: Error - BAD PASSWORD: It Does Not Contain Enough DIFFERENT Characters

Oct 29, 2010

I'm trying to change the password for an account using the passwd command in Linux. However I'm getting the error:

"BAD PASSWORD: it does not contain enough DIFFERENT characters"

Even though the passwords I'm trying seem pretty safe and complicated enough to me. I googled and think this is controlled by something called cracklib? Don't know for sure though. How can I change the settings for this, perhaps lowering the amount of different characters required, or disabling whatever security setting is causing this error?

View 4 Replies View Related

General :: Ps Command Is Visible In 80 Characters?

Sep 1, 2010

When i am running ps -ef command I am getting the execution of the commnad in "80characters"

View 5 Replies View Related







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