Pragmatism in the real world

Prepending to the terminal's prompt

For some work I’m doing, I have been given access to a Linux box that is part of a legacy production system.

The first thing I have done is updated the terminal prompt to include the word PRODUCTION in red, by adding this to .bashrc:

export PS1="$(tput setaf 1)PRODUCTION $(tput sgr0)$PS1"

The nice thing about doing it this way is that I don’t have to worry about whatever is in PS1 already.

Not the most complex thing and gives me a tell that I need to be careful.

Thoughts? Leave a reply

Your email address will not be published. Required fields are marked *