setf/setaf or how to portably add colors to your prompt

There are a million pages on the web that describe how to make your bash prompt nice and colorful. Most just hard-code the color sequences, which can break if you use a weird terminal. Until today I used some clever code I stole from somewhere that used tput to get the color codes from the termcap/terminfo database. Today I learned that there are two "standard" capabilities for setting colors: setf and setaf.

Back in the US of A

Typed up: on plane to Boston Posted from: Jane and Tom's place in Boston Back "home," we've been very busy. We stayed at Andy and Juliette's place for about a week and a half visiting friends and doing chores, before driving up to the Bay Area where I had a job interview. Things looked promising, we looked at apartments, I went to another interview just in case, Danielle had an interview.

M.V. Hanjin Pretoria

Typed up at: Laura and Alan's place in Emeryville, Starbucks in Palo Alto Posted from: Laura and Alan's place in Emeryville, Andy and Juliette's place in Newbury Park The port agent drove us to the place where our ship had just docked. The gangplank wasn't down yet, so we spent a while just standing next to the car taking pictures. It was dark, and huge cranes with bright lights were already starting to take containers off the ship.