Can i add colours to bourne Script ?

Can i add colours to bourne Script ?

Search for the following thread:
Changing korn shell script text Menu colors? darthur UNIX for Dummies Questions & Answers 6 161 01-20-2002 06:15 PM
by Shakey21

You can do this with vi

edit your file then hit "i" for insert
then do the following
control v "hit Esc" [33m
should give something like
^[[31m
this is your Escape character 33 is yellow 31 is red and you can try all other numbers

i got this after i follow wad u said..
^[[31m

bash: ./test1: cannot execute binary file

whats the like you are using it with?
maybe you need some echo

show me few lines up and down might help

just trying to add some colour to the bourne Script

echo " ^[[33m test

izzit like this ?

if i wan the word test got colour.. ?

You have to do this:

type the following:

echo " `Control V``Control [`[33m test"

Where anything in the ` ` is a double key entry.

Of course, then everything after that will be red. You have to put another set of escape sequence to turn off the color after the word test. (on my screen it was ^[[30m)

i am still getting this..

bash: ./test1: cannot execute binary file

this is wad i typed inside the file..
echo " ^[[33m test "

Type it on the command line (include the option to turn it off or back) to see if bash has a problem.

You wrote "inside the file" - check the type of file via the file test1 command. Also check your permissions on the file to insure it's executable.

no problem typing in command line..
how to check the type of file izzit?
permission is 700

can help me?
i am newbies to shell scripting..

[*@localhost *]$ ^[[34m test
bash: : command not found

i got this error msg ...
but the colour will change to dark blue

and after editing the file using vi, how do i quit ?
press 'Esc' and type ':exit' ? am i correct?
i seldom use vi editor ..
can anyone help ?
thank u

To save and quit out of vi, hit the escape key, then :, then wq

w writes the file
q quits out of vi

Before using commands, read the manual (or man page).

As far as the error but the color changed - you needed to put in echo " ^[[33m test ^[[30m"

Suggest you learn commands and how to use them before wanting to add bells and whistles.

ok thanks
i got it to work..

is there any way to make blinking text ?

xx="1"
while [ $xx ];
do
close i's
sleep 1
open i's
sleep 1
done

But this may not be what you were looking for.

^[[5m is blinking
^[[1m is brighter

u can do also ^[[31;5m for color + blinking or even ^[[31;5;1m

when i use ^[[5m for blinking...
i get a background colour of grey ..
and it never blink ..

no problem with brighter ..

it work on console pretty fine

am not sure if it works fine under xterm , i even used SecureCRT from winxx machine to ssh into a box that has blicking text works just fine