Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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. PS1='\u@\h \D{%d %b %Y %H:%M:%S} :\w\$ '
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
> 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 [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \d \t \[\033[01;34m\]\w\[\033[00m\$' else PS1='${debian_chroot:+($debian_chroot)}\u@\h: \d \t \w\$' fi Now, as Wooledge suggested, replace "\d \t" with "$(date +"%d %b %Y %H:%M:%S")".
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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'm just going to assume that it works like any other terminal -- bash > runs inside it. The prompt is displayed by bash. Therefore, the "guake" > part of the question can be ignored. > > > which is not bad but I would like it to be something like this - > > > > shirish@debian 14 Dec 2019 00:43:04 :~$ > > PS1='\u@\h $(date +"%d %b %Y %H:%M:%S") :\w\$ ' > > Bash actually has the ability to show the time in the prompt without > calling date(1), but you asked for an unusual date format, so I had to > resort to the command substitution. Could \D{format} not do that? Mind you, I'm surprised a prompt needs the month and year. I would have thought the day of the week would be more useful. Cheers, David.
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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 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 happens when you run > > guake and then run bash inside it? Are there options for guake > > to run bash as your shell automatically? > > I dunno. man guake ; look for ways to set the shell. Google for docs. Look for people who use guake -- perhaps at guake-project.org? -dsr-
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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: 3.24.13 >> > > guake is a terminal, not a shell. What happens when you run > guake and then run bash inside it? Are there options for guake > to run bash as your shell automatically? > > -dsr- > I dunno. I am on debian-mate and the only thing I know is that I have guake turned on my startup application/terminal once I enter mate-session. In guake preferences in Shell option it comes the default interpretor as but doesn't tell of a way so I can have it the way I shared using the current date and time - shirish@debian 14 Dec 2019 00:43:04 :~$ I am just using copying and pasting the time from before . Any idea/advice would be nice. I would rather have guake be the way it is and just have the prompt as I want it. -- Regards, Shirish Agarwal शिरीष अग्रवाल My quotes in this email licensed under CC 3.0 http://creativecommons.org/licenses/by-nc/3.0/ http://flossexperiences.wordpress.com E493 D466 6D67 59F5 1FD0 930F 870E 9A5B 5869 609C
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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 runs inside it. The prompt is displayed by bash. Therefore, the "guake" part of the question can be ignored. > which is not bad but I would like it to be something like this - > > shirish@debian 14 Dec 2019 00:43:04 :~$ PS1='\u@\h $(date +"%d %b %Y %H:%M:%S") :\w\$ ' Bash actually has the ability to show the time in the prompt without calling date(1), but you asked for an unusual date format, so I had to resort to the command substitution.
Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?
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 happens when you run guake and then run bash inside it? Are there options for guake to run bash as your shell automatically? -dsr-