help with colors

  • Thread starter Thread starter dns
  • Start date Start date
D

dns

Guest
Code:
#!/bin/sh
echo "^[[1;39m|=Test No Work=|^[[0m"

How no work ? :-(
 
Because you're typing it wrong. The ^[ is actually an embedded escape, typed with ctrl-v esc.

But that's not a good way to do things. Instead, use printf(1) to put in a readable escape character that won't mess with editors and viewers.
Code:
#!/bin/sh
printf "\033[1;39m|=Test Works=|\033[0m"
 
Back
Top