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...?