Sponsored Content
Top Forums Shell Programming and Scripting Color prompt with file numbers does not work anymore Post 302805441 by Jotne on Friday 10th of May 2013 05:27:08 AM
Old 05-10-2013
Color prompt with file numbers does not work anymore

I have used this color prompt on my servers for long time, in file ~\.bashrc
Code:
Black="\[\e[0;30m\]"
Dark="\[\e[Gray 1;30m\]"
Blue="\[\e[0;34m\]"
LBlue="\[\e[1;34m\]"
Green="\[\e[0;32m\]"
LGreen="\[\e[1;32m\]"
Cyan="\[\e[0;36m\]"
LCyan="\[\e[1;36m\]"
Red="\[\e[0;31m\]"
LRed="\[\e[1;31m\]"
Purple="\[\e[0;35m\]"
LPurple="\[\e[1;35m\]"
Brown="\[\e[0;33m\]"
Yellow="\[\e[1;33m\]"
LGray="\[\e[0;37m\]"
White="\[\e[1;37m\]"
Reset="\[\e[0m\]"
PS1="$Yellow\u@\h $LBlue\w $LGreen[$(ls | wc -l):$(($(ls -ad .* | wc -l)-2))]\$([ \$? = 0 ] && echo -e '$LGreen#$Reset' || echo -e '$LRed#$Reset'\)"

It gives a prompt like this
Code:
root$faster \tmp [5:2]#

The numbers [5:2] tells me there are 5 normal files and 2 hidden.

For some reason this does not work anymore when I change directory. I am not sure when this has stopped working. If run the PS1 variable manually, it updates the file number, but this should go automatically.
Anyone could test this as see if it works or not.
I do run my server on Ubuntu 32 and 64 bits 12.04
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change prompt color when changing path

Hi all, Can you tell me how to change the prompt color (only the path part) when I chnange directory with "cd"? I use the sequence below in ".bashrc" (Solaris 8) to change my prompt colors and I'd like to modify it to change the path color when I cange directory. PSC() { echo -ne "\"; }... (0 Replies)
Discussion started by: majormark
0 Replies

2. UNIX for Dummies Questions & Answers

connection doesn't work anymore

Hello, first of all, I want to make myself clear about my language. I'm brazilian, so I ask you all to understand if i commit any mistake with the grammar. Here is the problem. Some days ago I needed to use a "sh" command in the Terminal (I use a Mac OSX 10.5.6) followed by a file... (0 Replies)
Discussion started by: anubisbr
0 Replies

3. Shell Programming and Scripting

tcsh/csh: set prompt in production to color red

Hi folks This is our prompt at the moment oracle@pinkipinki:/opt/oracle> grep 'set prompt' .cshrc set prompt = "$user@`uname -n`:$cwd> " We wish to have in production the same prompt, but red. Howto do that? I tried a lot a internet manuals, but it doesn't work. (1 Reply)
Discussion started by: slashdotweenie
1 Replies

4. Shell Programming and Scripting

Extract numbers from text file work out average

Just wondering if someone could assist me with shell script I'm trying to write. I need to read the final column of a text file (shown below) and workout what the average number is. The text file will have a variable number of lines, I just want the script to pull out the values in the final field... (14 Replies)
Discussion started by: rich@ardz
14 Replies

5. Shell Programming and Scripting

Color on echo output does not work

Hi, When I run: echo "\033I see hi in color, but if I run this color is not shown, why? (echo "\033Thanks Israel. ---------- Post updated at 05:17 AM ---------- Previous update was at 04:43 AM ---------- DONE!! I had to run more -v. Thanks (4 Replies)
Discussion started by: iga3725
4 Replies

6. UNIX for Advanced & Expert Users

pkill won't work on firefox anymore

Can someone tell me why pkill won't work on firefox anymore? (11 Replies)
Discussion started by: cokedude
11 Replies

7. Shell Programming and Scripting

zsh, prompt, variable expansion, ANSI color sequences

Hi! I am using latest ZSH and I have setopt prompt_subst I have a global hash array variable which contains some color definitions with color names as keys and 256-color ANSI codes (with %{ and %}) as values, eg %{\ePS1="$FG Hello World (%M) > " or PS1=$'$FG Hello World (%M) > ' then it... (3 Replies)
Discussion started by: galanom
3 Replies

8. UNIX for Advanced & Expert Users

Libvirt does not work correctly anymore on my gentoo

Hi, Since a year my libvirtd does not work anymore on my Gentoodesktop. In the meantime a used virtualbox. But I would like to have back libvirt. The problem was after libvirt should not only work with root privileges. I deinstalled all things with libvirt an kvm. I removed all things from /var... (4 Replies)
Discussion started by: darktux
4 Replies

9. Red Hat

RHEL6 customizing prompt do not work

Hi, I'm trying to customize the ksh prompt for users on a RHEL 6.6 system for having user@host pwd : $ and user@host pwd # in red color for root. I think it's possible but i do not even succeded for a non root user : I added in my ~/.kshrc : PS1="Hello : " and it works but when i... (4 Replies)
Discussion started by: Fundix
4 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy