Sponsored Content
Full Discussion: Custom PS1 "anamoly"
Top Forums Shell Programming and Scripting Custom PS1 "anamoly" Post 302442477 by Habitual on Wednesday 4th of August 2010 10:52:07 AM
Old 08-04-2010
Custom PS1 "anamoly"

Hello:

Any bash PS1 gurus in the house?
I have a custom 2-line prompt and it displays fine, but there is an occasional anomaly.
The backspace key sometimes takes out the 2nd line.
Here's the relevant ~/.bashrc code:

Code:
MKF='This is my Kung-Fu'
DOS='C:${PWD//\//\\\}>'
PS1="\[\033[01;31m\]$MKF\n\[\033[00m\]\[$DOS\033[00m\]"

and the C:\home\JJ> gets removed on occasion by backspace key strokes.

Here's what I notice at the 2nd line of the prompt.
I can type vi (space) and then backspace 3 times and it's gone. I can still type commands but on an empty line.

Versions:
GNU bash, version 4.0.38
GNOME Terminal 2.28.2 (embedded on the desktop using devilspie)
It does same in terminal 0.4.5 (Xfce 4.6.2)

I have checked|studied 17 sites and got this far, now I need your help.

Thanks for your time!

Dis-regard, all fixed.
<code>
PS1="\[\033[01;31m\]$MKF\n\[\033[00m\]\[\033[01;33m\]$DOS\[\033[00m\]"
</code>

Thanks Gurus!

Last edited by Habitual; 08-04-2010 at 04:02 PM.. Reason: woof
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

"BOLD" printing a variable in PS1 command

I would like to "BOLD" print the hostname in the following statement: export PS1=$USER"@"$(hostname -s):'$PWD>' Is there a special character I can put before and after the variable to make it bold or blinking? Thanks. (4 Replies)
Discussion started by: pdtak
4 Replies

3. Shell Programming and Scripting

Adding custom mesg. when redirecting "exec 2>stderr.err" ?

Doubt regarding using "exec" command to redirect the STDERR to a file. e.g I did it this way. mystage.sh #!/bin/sh exec 2>stage.err .... .... cat stage.err mv: cannot move `/root/stage' to a subdirectory of itself, `/root/stage_old/stage' ls: *.zDB: No such file or... (0 Replies)
Discussion started by: snurani
0 Replies

4. Programming

Adding custom ("Hello") system call: help

I'm trying to add a custom ("Hello world" :o) system call. In /usr/src/linux/hello/ I put simple hello.c ...#include "linux/linkage.h" // for linking a system call #include "linux/kernel.h" // for "printk" asmlinkage int sys_hello() { printk(KERN_ALERT "Hello!"); return 1; }... and in... (5 Replies)
Discussion started by: courteous
5 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
Math::Symbolic::Custom::Base(3pm)			User Contributed Perl Documentation			 Math::Symbolic::Custom::Base(3pm)

NAME
Math::Symbolic::Custom::Base - Base class for tree tests and transformations SYNOPSIS
# Extending the Math::Symbolic::Custom class: package Math::Symbolic::Custom::MyTransformations; use Math::Symbolic::Custom::Base; BEGIN {*import = &Math::Symbolic::Custom::Base::aggregate_import} our $Aggregate_Export = [qw/apply_transformation1 .../]; sub apply_transformation1 { # ... } DESCRIPTION
This is a base class for your extensions to the Math::Symbolic::Custom class. To extend the class, just use the following template for your custom class: package Math::Symbolic::Custom::MyTransformations; use Math::Symbolic::Custom::Base; BEGIN {*import = &Math::Symbolic::Custom::Base::aggregate_import} our $Aggregate_Export = [...]; # exported subroutines listed here. # Now implement the subroutines. # Exported subroutine names must start with 'apply_', 'mod_', # 'is_', 'test_', 'contains_', or 'to_' # ... 1; EXPORT Uses a custom exporter implementation to export certain routines from the invoking namespace to the Math::Symbolic::Custom namespace. But... Nevermind. SUBROUTINES
aggregate_import aggregate_import() is the only public subroutine defined by Math::Symbolic::Custom::Base and should only be called in BEGIN blocks like the one shown in the SYNOPSIS above. AUTHOR
Please send feedback, bug reports, and support requests to the Math::Symbolic support mailing list: math-symbolic-support at lists dot sourceforge dot net. Please consider letting us know how you use Math::Symbolic. Thank you. If you're interested in helping with the development or extending the module's functionality, please contact the developers' mailing list: math-symbolic-develop at lists dot sourceforge dot net. List of contributors: Steffen Mueller, symbolic-module at steffen-mueller dot net Stray Toaster, mwk at users dot sourceforge dot net Oliver Ebenhoeh SEE ALSO
New versions of this module can be found on http://steffen-mueller.net or CPAN. The module development takes place on Sourceforge at http://sourceforge.net/projects/math-symbolic/ Math::Symbolic perl v5.10.1 2011-01-01 Math::Symbolic::Custom::Base(3pm)
All times are GMT -4. The time now is 02:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy