Some dumb questions born of frustration

Karl Wilbur karl at karlwilbur.net
Thu Oct 27 21:24:26 UTC 2016


Here's a like more detail on what you can do with your prompt:

http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/

http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command

--
Karl Wilbur
513-322-2481
karl at karlwilbur.net

On Oct 27, 2016 08:52, "Tim Chase" <blinux.list at thechases.com> wrote:

> On October 27, 2016, Jeffery Mewtamer wrote:
> > is there any way I could add a short indicator of the active
> > terminal before the $? Something along the lines of tty2$ when I'm
> > using tty2 and tty3$ when I'm using tty3.
>
> You should be able to change that to
>
>   export PS1="$(tty)$"
>
> which would set your prompt to the full path, something like
>
>   /dev/tty1$
>
> You could trim off the leading "/dev/" with
>
>   export PS1="$(tty | sed 's#^/dev/##')$"
>
> which would reduce it to just
>
>   tty1$
>
> This does merely assign it once when it's evaluated in your .bashrc,
> so if you use something like reptyr(1) to move your shell to another
> terminal, it won't update so you'd have to re-source your .bashrc
> again.  Not a big deal and not something your average user is apt to
> encounter, but still something to keep in mind.
>
> -tim
>
>
>
>
> _______________________________________________
> Blinux-list mailing list
> Blinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/blinux-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/blinux-list/attachments/20161027/6a09335f/attachment.htm>


More information about the Blinux-list mailing list