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 printed. > > Do you mean something like this ? > > $ echo -n 'user@mypc: # bash script has just finished! ' > user@mypc: # bash script has just finished! $
Yep, that's possibly the easiest option: doing the "painting" from whithin the script and not from the enclosing shell. Another avenue would be, since PS1 does shell expansion dynamically, to embed some command à la $(foo) whithin PS1. How that command communicates with your script is left as an exercise to the reader :) To illustrate what I may have expressed poorly above, try export PS1='Today is $(date). Your wish is my command: ' Have fun :) -- t
signature.asc
Description: Digital signature