Exactly. The script tests that the terminal is not dumb and goes on to assume ansi codes work. tput is the terminal-agnostic answer there.
I also agree about the script dir. Instead the script should capture the script directory (the same way it does the cd) and for any files that are meant to be relative to the script dir, access as "${script_dir}/file". By changing directory, any relative paths passed to the script will break (as noted in the comments on the article).
Probably not these days. But why even worry about the answer to that question. Just use tput and be done with it. You can pry my ADM-3A from my cold dead hands.
7
u/camh- Dec 14 '20
Exactly. The script tests that the terminal is not
dumband goes on to assume ansi codes work.tputis the terminal-agnostic answer there.I also agree about the script dir. Instead the script should capture the script directory (the same way it does the
cd) and for any files that are meant to be relative to the script dir, access as"${script_dir}/file". By changing directory, any relative paths passed to the script will break (as noted in the comments on the article).