I\'m writing a shell script that uses ANSI color characters on the command line.
Example: example.sh
#!/bin/tcsh
printf \"\\033[31m Succ
See this previous SO question, which covers bash. Tcsh provides the same functionality with filetest -t 1
to see if standard output is a terminal. If it is, then print the color stuff, else leave it out. Here's tcsh:
#!/bin/tcsh
if ( -t 1 ) then
printf "\033[31m Success Color is awesome!\033[0m"
else
printf "Plain Text is awesome!"
endif