Sponsored Content
Full Discussion: Changing PS1
Top Forums Shell Programming and Scripting Changing PS1 Post 302733247 by kristinu on Tuesday 20th of November 2012 03:23:33 AM
Old 11-20-2012
Changing PS1

I have coded PS1 as shown, producing the following result when writing on the command line

Code:
┌─ cdl[/media/ios120/chrisd/tomso-12.04/source]
└──╼ make tracepdf2d

If I make an error in the command an ✗ is printed
Code:
┌─ ✗ cdl[/media/ios120/chrisd/tomso-12.04/source]
└──╼ ls-a
ls-a: command not found

My problem is that if I just press enter, I do not want to have the ✗ printed.




Code:
    PS1="\[\033[0;37m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \" \[\033[0;31m\]\342\234\2
27\[\033[0;37m\]\342\224\")$(if [[ ${EUID} == 0 ]]; then echo '\[\033[0;31m\]\h'; else echo '\[\033[
01;33m\] cdl'; fi)\[\033[0;37m\][\[\033[01;34m\]\w\[\033[0;37m\]]\n\[\033[0;37m\]\342\224\224\342\22
4\200\342\224\200\342\225\274 \[\033[0m\]"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I changed PS1 and now ....

Hello I am using Debain Potato and I changed the PS1. When I log in locally everythink is fine, except that when I enter a long row without hitting enter, then it word wraps automatically. And it does it not at the end of the row, it does it in the middle of the row! It also does not writes... (7 Replies)
Discussion started by: Fwurm
7 Replies

2. UNIX for Dummies Questions & Answers

Very simple question about changing PS1 variable at startup!

Hello there ! I am new in this Unix world and just start learning Unix. I have very simple question about changing PS1 variable (Shell Prompt) i have local.profile file in my working directory, i open in vi edit mode and add this line PS1="Hello:>" and i save that file. I disconnected from... (2 Replies)
Discussion started by: abidmalik
2 Replies

3. UNIX for Advanced & Expert Users

PS1 variable

I want to set my prompt to something more descriptive than a plain old $, so I set the PS1 variable as such: PS1="" Which changes the prompt correctly, but when I change directories, it does not update the prompt. So I tried this: PS1="`pwd`>" I get the same results when changing... (2 Replies)
Discussion started by: dangral
2 Replies

4. UNIX for Dummies Questions & Answers

PS1 problem

can anyone tell me how to change the $ prompt by calling a variable. Say for example i called a var 'enable' I and would like the $ prompt to change to a phrase like 'my prompt' any help would be great (1 Reply)
Discussion started by: pg080394
1 Replies

5. UNIX for Dummies Questions & Answers

PS1 prompt

please advise what's wrong with this command ? PS1="`hostname`:`who am i | cut -d " " -f1`:>>" trying to make the PS1 prompt look like : machine_name:username:>> thank you (4 Replies)
Discussion started by: venhart
4 Replies

6. Shell Programming and Scripting

Help with Export PS1 I think :-0

I am 100% new to Unix and trying to learn. This is my first time even touching a script in Unix. We have the following variable script that I am trying to run.... ################################## ###### variable test### ################################## Hostname=`hostname`... (3 Replies)
Discussion started by: LRoberts
3 Replies

7. Shell Programming and Scripting

PS1 challenge

Ok then i Have a challenge for you : Give me PS1 so that it always display the least 2 levels of directory (except if i am above of course) I want it this way : so if i go to / /home/ /home/user /home/user/whatever /home/user/whatever1/whatever2 my PS1 should respectively... (12 Replies)
Discussion started by: ctsgnb
12 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Help needed to have changing value to the command prompt string variable PS1

Hi, I am using git bash terminal window to do git operations. I have set the prompt string variable PS1 in the ~/.bashrc file as follows: export PS1=" " This is intended to show me the current git branch's name which is active as part of the prompt string. But, the problem is when I do a git... (2 Replies)
Discussion started by: royalibrahim
2 Replies

9. Solaris

Help changing the PS1 prompt in Solaris

Hi, I need help changing PS1 in Solaris. I tried this: MYPROMPT="> " PS1=$LOGNAME@$HOSTNAME:${PWD}$MYPROMPT (NOT SURE WHY IT'S HIGHLIGHTED HERE) export PS1 My problem is that $PWD is not working, when I get the prompt and I change directories, the prompt is not displaying the current... (17 Replies)
Discussion started by: curiousmal
17 Replies

10. UNIX for Dummies Questions & Answers

PS1 - change

Hello I am attempting to generate a bash scrip that prompts me at loggin to change my PS1 - However, I am running into an issue w/ the code. #!/bin/bash #the point of this script is to that it automates and changes my prompts every day msg1="What do you feel like adding today :" echo... (11 Replies)
Discussion started by: D'go
11 Replies
colormake(1)						      General Commands Manual						      colormake(1)

NAME
colormake - color wrapper for make(1) SYNOPSIS
colormake [ --short ] ... DESCRIPTION
colormake acts as a wrapper around make(1) to ease reading the output by colorizing it. OPTIONS
The --short option instructs colormake to truncate lines so they do not wrap. All other options will be passed unmodified to make(1). USAGE
To change a makefile to use colormake, you may change the path at the top which normally reads #!/usr/bin/make to #!/usr/bin/colormake. Alternately, you may type colormake whenever you would normally type make when compiling programs. Colormake is also available using the alternate names which enable piping through less (clmake), truncated output so lines do not wrap (colormake-short), or both (clmake-short). FILES
The configuration files are Perl scripts included by colormake.pl. The defaults values are (from colormake.pl itself): # Some useful color codes, see end of file for more. # $col_black = "33[30m"; $col_red = "33[31m"; $col_green = "33[32m"; $col_yellow = "33[33m"; $col_blue = "33[34m"; $col_magenta = "33[35m"; $col_cyan = "33[36m"; $col_ltgray = "33[37m"; $col_norm = "33[00m"; $col_background = "33[07m"; $col_brighten = "33[01m"; $col_underline = "33[04m"; $col_blink = "33[05m"; # Customize colors here... # $col_default = $col_ltgray; $col_gcc = $col_magenta . $col_brighten; $col_make = $col_cyan; $col_filename = $col_yellow; $col_linenum = $col_cyan; $col_trace = $col_yellow; $col_warning = $col_green; $tag_error = ""; $col_error = $tag_error . $col_yellow . $col_brighten; $error_highlight = $col_brighten; For use with gnome-terminal I have the following configuration in my $HOME/.colormakerc file: $col_default = $col_black; $col_gcc = $col_magenta; $col_filename = $col_blue; $col_linenum = $col_cyan; $col_error = $tag_error . $col_red . $col_brighten; /usr/share/colormake/colormake.rc System-wide configuration file for colormake. $HOME/.colormakerc Personal configuration file for colormake. HISTORY
/usr/bin/colormake was formerly named /usr/bin/cmake but had to be renamed because of a name clash. AUTHORS
Bjarni R. Einarsson is the author of colormake. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. This manual page was written by Joe Wreschnig <piman@sacredchao.net> and updated by Ludovic Rousseau <rousseau@debian.org>, for the Debian GNU/Linux system (but may be used by others). SEE ALSO
make(1), clmake(1) July 2nd, 2001 colormake(1)
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy