Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-16 Thread Greg Wooledge
On Fri, Dec 13, 2019 at 04:50:18PM -0600, David Wright wrote: > > PS1='\u@\h $(date +"%d %b %Y %H:%M:%S") :\w\$ ' > > Could \D{format} not do that? Oh, good catch. I've... never used that before. ;-) I scanned the PROMPTING section of the man page too quickly and only saw the \t \T \@ \A parts.

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread Vipul
> if [ "$color_prompt" = yes ]; then > > PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\$ > ' You forgot to add "\d", in PS1 value, that explains different behavior of prompt in console and Guake. May be, this could fix the problem if [

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread David Wright
On Fri 13 Dec 2019 at 14:36:09 (-0500), Greg Wooledge wrote: > On Fri, Dec 13, 2019 at 07:20:53PM +, shirish शिरीष wrote: > > Can somebody share how can I have a common prompt which is ok both by > > bash and guake ? > > guake...? No idea what that is. apt-cache says it's a terminal. So > I

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread Dan Ritter
shirish ??? wrote: > at bottom :- > > On 13/12/2019, Dan Ritter wrote: > > shirish ??? wrote: > >> Dear all, > >> > >> Can somebody share how can I have a common prompt which is ok both by > >> bash and guake ? > >> > >> bash is - > >> > >> $ guake --version > >> Guake Te

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread shirish शिरीष
at bottom :- On 13/12/2019, Dan Ritter wrote: > shirish ??? wrote: >> Dear all, >> >> Can somebody share how can I have a common prompt which is ok both by >> bash and guake ? >> >> bash is - >> >> $ guake --version >> Guake Terminal: 3.6.3 >> VTE: 0.58.2 >> VTE runtime: 0.58.2 >> Gtk

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread Greg Wooledge
On Fri, Dec 13, 2019 at 07:20:53PM +, shirish शिरीष wrote: > Can somebody share how can I have a common prompt which is ok both by > bash and guake ? guake...? No idea what that is. apt-cache says it's a terminal. So I'm just going to assume that it works like any other terminal -- bash run

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread Dan Ritter
shirish ??? wrote: > Dear all, > > Can somebody share how can I have a common prompt which is ok both by > bash and guake ? > > bash is - > > $ guake --version > Guake Terminal: 3.6.3 > VTE: 0.58.2 > VTE runtime: 0.58.2 > Gtk: 3.24.13 > guake is a terminal, not a shell. What happe

how to have a common prompt in bash and guake so I can view date and time as part of prompt ?

2019-12-13 Thread shirish शिरीष
Dear all, Can somebody share how can I have a common prompt which is ok both by bash and guake ? bash is - $ bash -version GNU bash, version 5.0.11(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later

Re: Temporary color prompt in bash script

2019-09-03 Thread David Wright
On Tue 03 Sep 2019 at 14:20:11 (-0400), Greg Wooledge wrote: > On Tue, Sep 03, 2019 at 01:07:08PM -0500, David Wright wrote: > > Trap is designed to break the sequential flow of commands. > > I can't see any reason to do that when the OP wants the > > sequence: > > > > execute a script > >

Re: Temporary color prompt in bash script

2019-09-03 Thread Greg Wooledge
On Tue, Sep 03, 2019 at 01:07:08PM -0500, David Wright wrote: > Trap is designed to break the sequential flow of commands. > I can't see any reason to do that when the OP wants the > sequence: > > execute a script > print a string Are you actually able to discern the OP's desires? I can'

Re: Temporary color prompt in bash script

2019-09-03 Thread David Wright
On Tue 03 Sep 2019 at 15:07:43 (+), Larry Dighera wrote: > On Mon, 02 Sep 2019 08:48:50 +0200, Computer Planet > > wrote: > > >Is It possible to print of a string at the exit of a bash script? > > Have a look at `man bash` and search for 'trap.' Trap is designed to break the sequential fl

Fw: Temporary color prompt in bash script

2019-09-03 Thread Larry Dighera
On Mon, 02 Sep 2019 08:48:50 +0200, Computer Planet wrote: >Is It possible to print of a string at the exit of a bash script? Have a look at `man bash` and search for 'trap.' trap [-lp] [[arg] sigspec ...]               The command arg is to be read and executed when the shell receives signa

Re: Temporary color prompt in bash script

2019-09-02 Thread David Wright
On Mon 02 Sep 2019 at 08:48:50 (+0200), Computer Planet wrote: > Thanks guys, > but this is not the solution I'm looking for ... It's always nice to get feedback on why, so that we're more likely to understand similar questions in future. For example, you never really explained whether "command n

Re: Temporary color prompt in bash script

2019-09-02 Thread tomas
On Mon, Sep 02, 2019 at 09:30:44AM +0200, Thomas Schmitt wrote: > Hi, > > Computer Planet wrote: > > Is It possible to print of a string at the exit of a bash script? > > e.g.: user@mypc: # bash script has just finished! [prompt] > > with the prompt that remains immediately after the string printe

Re: Temporary color prompt in bash script

2019-09-02 Thread Thomas Schmitt
Hi, Computer Planet wrote: > Is It possible to print of a string at the exit of a bash script? > e.g.: user@mypc: # bash script has just finished! [prompt] > with the prompt that remains immediately after the string printed. Do you mean something like this ? $ echo -n 'user@mypc: # bash script

Re: Temporary color prompt in bash script

2019-09-02 Thread tomas
On Mon, Sep 02, 2019 at 08:48:50AM +0200, Computer Planet wrote: > Thanks guys, > but this is not the solution I'm looking for ... > Now, I ask the question in other terms: > Is It possible to print of a string at the exit of a bash script? Hm. You mean echo Still a bit confused about where y

Re: Temporary color prompt in bash script

2019-09-01 Thread Computer Planet
Thanks guys, but this is not the solution I'm looking for ... Now, I ask the question in other terms: Is It possible to print of a string at the exit of a bash script? e.g.: user@mypc: # bash script has just finished! [prompt] with the prompt that remains immediately after the string printed. Th

Re: Temporary color prompt in bash script

2019-09-01 Thread tomas
On Sun, Sep 01, 2019 at 03:22:32PM -0400, Lee wrote: [...] > You have to source the script instead of running it. Yes, exactly. > I'm not entirely clear about a new shell gets it's own env that > disappears when the shell exits thing, but try this: It's not only a shell thing. It's a basic Uni

Re: Temporary color prompt in bash script

2019-09-01 Thread Lee
On 9/1/19, Computer Planet wrote: > Hi guys! > I'm trying, trying and trying but... > > How I Can put in hte end of a bash script this command: > PS1="\[\e]0;\u@\h: > \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w > #\[\033[91m\] " > so that after finish

Re: Temporary color prompt in bash script

2019-09-01 Thread David Wright
On Sun 01 Sep 2019 at 17:53:51 (+0200), Computer Planet wrote: > Hi guys! > I'm trying, trying and trying but... > > How I Can put in hte end of a bash script this command: > PS1="\[\e]0;\u@\h: > \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w > #\[\033

Temporary color prompt in bash script

2019-09-01 Thread Computer Planet
Hi guys! I'm trying, trying and trying but... How I Can put in hte end of a bash script this command: PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w #\[\033[91m\] " so that after finishing the script the prompt will write in red...?

Re: ???current directory in prompt in bash???

1998-12-08 Thread wtopa
Subject: Re: ???current directory in prompt in bash??? Date: Tue, Dec 08, 1998 at 11:29:18AM -0500 In reply to:Wayne Topa Quoting Wayne Topa([EMAIL PROTECTED]): > > Subject: ???current directory in prompt in bash??? > Date: Tue, Dec 08, 1998 at 08:38:0

Re: ???current directory in prompt in bash???

1998-12-08 Thread wtopa
Subject: ???current directory in prompt in bash??? Date: Tue, Dec 08, 1998 at 08:38:00AM + In reply to:[EMAIL PROTECTED] Quoting [EMAIL PROTECTED]([EMAIL PROTECTED]): > > Is there a way to have bash include the current directory in the > prompt of bash? Actually,

Re: ???current directory in prompt in bash???

1998-12-08 Thread Mitch Blevins
Rich Hartman wrote: > Is there a way to have bash include the current directory in the > prompt of bash? Actually, let me re-phrase that my "root" account > DOES include the current directory in the the prompt, but I have no > idea why or how... I've tried to copy my root's .bash_profile to

Re: ???current directory in prompt in bash???

1998-12-08 Thread Kent West
At 08:38 AM 12/8/1998 +, Rich Hartman wrote: >Is there a way to have bash include the current directory in the >prompt of bash? Actually, let me re-phrase that my "root" account >DOES include the current directory in the the prompt, but I have no >idea why or how... I've tried to copy my

Re: ???current directory in prompt in bash???

1998-12-08 Thread Stephan Engelke
Hi Rich, On Tue, Dec 08, 1998 at 08:38:00AM +, Rich Hartman wrote: > Is there a way to have bash include the current directory in the > prompt of bash? Actually, let me re-phrase that my "root" account > DOES include the current directory in the the prompt, but I have no > idea why or h

Re: ???current directory in prompt in bash???

1998-12-08 Thread David Z. Maze
Rich Hartman <[EMAIL PROTECTED]> writes: Rich> Is there a way to have bash include the current directory in the Rich> prompt of bash? Yes. See bash(1), under "PROMPTING". -- _ / \ "Dad was reading a book called | David Maz

???current directory in prompt in bash???

1998-12-08 Thread Rich Hartman
Is there a way to have bash include the current directory in the prompt of bash? Actually, let me re-phrase that my "root" account DOES include the current directory in the the prompt, but I have no idea why or how... I've tried to copy my root's .bash_profile to my "regular-user's" .bash_p

Re: Prompt in Bash [fixed]

1997-09-07 Thread Rob Browning
Will Lowe <[EMAIL PROTECTED]> writes: > Yup, kill the "eval" and life is good. Thanks, Mr. Browning. You're welcome, but sheesh, call me Rob :> One final word for those who were following this thread. This if [ ${PS1:-UNSET} = UNSET ] should have been if [ "${PS1:-UNSET}" = UNSET ] W

Re: Prompt in Bash [fixed]

1997-09-06 Thread Will Lowe
On 6 Sep 1997, Rob Browning wrote: > "Gonzalo A. Diethelm" <[EMAIL PROTECTED]> writes: > > > Rob, thanks a lot for your script. I think there is a small glitch, > > though: > export PROMPT_COMMAND='eval set_titlebar [EMAIL PROTECTED]:`my_dirname`' Yup, kill the "eval" and life is good. Thanks

Re: Prompt in Bash

1997-09-06 Thread Rob Browning
"Gonzalo A. Diethelm" <[EMAIL PROTECTED]> writes: > Rob, thanks a lot for your script. I think there is a small glitch, > though: Not surprised :> > > export PS1='\n\!\$ ' > > export PROMPT_COMMAND='eval set_titlebar [EMAIL > PROTECTED]:`my_dirname`' > > When I did this, the title ba

Re: Prompt in Bash

1997-09-06 Thread Gonzalo A. Diethelm
Rob, thanks a lot for your script. I think there is a small glitch, though: > if [ ${PS1:-UNSET} = UNSET ] > then > INTERACTIVE_SHELL=F > else > INTERACTIVE_SHELL=T > > if [ "$TERM" = xterm -o "$TERM" = rxvt ] > then > set_titlebar () { echo -n "]2;$*"; } > expor

Re: Prompt in Bash

1997-09-06 Thread Rob Browning
Will Lowe <[EMAIL PROTECTED]> writes: > Ok, now I get a > [EMAIL PROTECTED]:~: command not found > > [EMAIL PROTECTED]:~ is what should end up in the titlebar, but it's instead > somehow being evaluated. Any other clues? Email me a snippet that causes the problem, and I'll check it out. If

Re: Prompt in Bash

1997-09-06 Thread Rob Browning
Michael Harnois <[EMAIL PROTECTED]> writes: > Since you're providing enlightenment ... Don't know if I'd go that far :> > This string works find in a "straight" .bashrc. However, when I use it > in your file, it works fine on a login shell. When I start a subshell, > though, I get I'd have to

Re: Prompt in Bash

1997-09-06 Thread Will Lowe
On 5 Sep 1997, Rob Browning wrote: > Will Lowe <[EMAIL PROTECTED]> writes: > > > > set_titlebar () { echo -n "]2;$*"; } > Here ^[ and ^G actually have to be real control characters not a ^ Ok, now I get a [EMAIL PROTECTED]:~: command not found [EMAIL PROTECTED]:~ is what should end up

Re: Prompt in Bash

1997-09-06 Thread Michael Harnois
Since you're providing enlightenment ... I ran into a problem when I tried to modify your script for my own preferences. Specifically, when I tried to change the value of PS1 to give a colorized prompt. The string I began with was PS1="\\[\\e[1;31m\\]\h:\\[\\e[0m\\]\\[\\e[1;34m\\]

Re: Prompt in Bash

1997-09-05 Thread Michael Harnois
"Jens B. Jorgensen" <[EMAIL PROTECTED]> writes: > Gonzalo A. Diethelm wrote: > > > > A while ago, somebody in this forum posted how to make the current > > working directory appear on the title bar in an xterm. I lost that > > article somehow; could the author repost it? Thanks in advance... > >

Re: Prompt in Bash

1997-09-05 Thread Rob Browning
Will Lowe <[EMAIL PROTECTED]> writes: > If I do this: > > On 5 Sep 1997, Rob Browning wrote: > > > set_titlebar () { echo -n "]2;$*"; } > > export -f set_titlebar > > And then someplace call "set_titlebar", I just get ^[]2;$*^G > echoed to my terminal. It doesn't ever set the

Re: Prompt in Bash

1997-09-05 Thread Will Lowe
If I do this: On 5 Sep 1997, Rob Browning wrote: > set_titlebar () { echo -n "]2;$*"; } > export -f set_titlebar And then someplace call "set_titlebar", I just get ^[]2;$*^G echoed to my terminal. It doesn't ever set the titlebar. I'm using rxvt. Suggestions?

Re: Prompt in Bash

1997-09-05 Thread Steve Witt
On Sat, 6 Sep 1997, Lawrence wrote: > Is it possible to do it in tcsh? > Yes, this is from the O'Reilly book "Using csh & tcsh". I use this at work on SunOS 4.1.4 running tcsh. There are two files involved, your .cshrc (or .tchsrc) and another little file ~/.settitle. = .cshrc == #--

Re: Prompt in Bash

1997-09-05 Thread Rob Browning
Lawrence <[EMAIL PROTECTED]> writes: > Is it possible to do it in tcsh? Good question. I've never used tcsh, but I would guess so. The key thing to note is this escape sequence which changes the titlebar: echo -n "]2;$*" or with a fixed string for illustration: echo -n "]2;My new

Re: Prompt in Bash

1997-09-05 Thread Rob Browning
"Jens B. Jorgensen" <[EMAIL PROTECTED]> writes: > Well, you should have RTFMpage, but here's the excerpt you want: That seems a little over-harsh. >a command. Bash allows these prompt strings to be cus­ >tomized by inserting a number of backslash-escaped special >char

Re: Prompt in Bash

1997-09-05 Thread Lawrence
Is it possible to do it in tcsh? Rob Browning wrote: > > Ask and ye shall receive :> This is a cut-down version of my bashrc. > It also shows a trick to get around the problem with some shells > actually being login shells, but not calling .bash_login (i.e. X login > shells). I just symlink my .

Re: Prompt in Bash

1997-09-05 Thread Jens B. Jorgensen
Gonzalo A. Diethelm wrote: > > A while ago, somebody in this forum posted how to make the current > working directory appear on the title bar in an xterm. I lost that > article somehow; could the author repost it? Thanks in advance... > Well, you should have RTFMpage, but here's the excerpt you

Re: Prompt in Bash

1997-09-05 Thread Rob Browning
Ask and ye shall receive :> This is a cut-down version of my bashrc. It also shows a trick to get around the problem with some shells actually being login shells, but not calling .bash_login (i.e. X login shells). I just symlink my .bash_login to my .bashrc, and let .bashrc handle figuring out wh

Re: Prompt in Bash

1997-09-05 Thread Gonzalo A. Diethelm
A while ago, somebody in this forum posted how to make the current working directory appear on the title bar in an xterm. I lost that article somehow; could the author repost it? Thanks in advance... On Aug 22, 1997, at 22:44, Dave Cinege wrote: > On Fri, 22 Aug 1997 12:32:35 -0300 (EST), Daniel

Re: Prompt in Bash

1997-08-23 Thread Dave Cinege
On Fri, 22 Aug 1997 12:32:35 -0300 (EST), Daniel Doro Ferrante wrote: > > > Hi All ! > > Does anybody know how do I change colors in a bash prompt. I can >do it in tcsh, but no succes with bash... (even after reading the man). #b/w prompt #PS1="\\h\\$ \\u [\\w] " #Pretty color promp

Prompt in Bash

1997-08-22 Thread Daniel Doro Ferrante
Hi All ! Does anybody know how do I change colors in a bash prompt. I can do it in tcsh, but no succes with bash... (even after reading the man). Thanks in advance. Daniel.