0
votes
0answers
21 views

Customized bash prompt (PS1) issues when text moving to next line and back.(word wrapping) [duplicate]

I'm using a customized prompt which includes and output of a "case" script and also colors it. When the text is colored I'm having line wrapping issues, when I remove the color - the issue is gone. ...
0
votes
2answers
48 views

Making PS1 prompt refreshable

I want my prompt to be changed based on an output of a certain command. and based on the command result to add a color. example: run the command: cphaprob stat | grep local | awk '{ print $NF }'` ...
3
votes
1answer
51 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
0
votes
2answers
94 views

Sending special bash characters to a custom function

I read this great article on customizing the bash prompt: http://blog.superuser.com/2011/09/21/customizing-your-bash-command-prompt/ I also read about using 256 colors in bash: ...
1
vote
3answers
91 views

Is it possible to have environment variables in the path of the working directory : PS1?

I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is : PS1="\w> " I like it because I need to paste the working directory all the time. The problem is that the path is always very long ...
0
votes
1answer
76 views

Prompt Customization Query - PS1='[\u@\h]\!:echo $? $ '

If in .bashrc the following reports the 'history number of the current command' (and the exit code of the last command), how can I configure it to report the 'history number of the previous command'? ...
0
votes
3answers
2k views

How to change the PS1 value.

I am logged in as the root of a Linux 2.6.18 machine. I changed the value of PS1 as: export PS1="$PWD> " It works and hardcodes the command prompt as the home directory followed by a >. Now ...
1
vote
1answer
412 views

Make Bash's PS1 show original directory name and not symlink?

I currently have PS1='\W' but when in a symbolic link'd directory, the prompt shows the symlink name, how can I make PS1 to show the original directory name?
3
votes
1answer
199 views

Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?

My prompt is such: PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] " So as output after I ls i see this: jake@myserver ~/public_html$ ~/public_html$ When I should only (I think) see: ...