Text color in Linux scripts via putty

hi Folks,

Can anyone help with changing the color of the words in a linux shell script?

I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript.

Is there a way to have one color in a linux shell script?

I attach an example of the color issue in a linux script.

Thanks for any help.

jd

looks like you you're using vim for editing (probably aliased to vi ).
Try vi -u NONE myFile

That looks more like a "feature" of your editor marking / highlighting different key words / types with different colours. Should be switchable. Check your editor's man page.

In my profile, I always include:-

unalias grep  2>/dev/null
unalias ls    2>/dev/null
unalias vi    2>/dev/null

This generally removes the silly colouring of output, such as "dark blue on black" or "yellow on white"

Maybe I'm too old and fondly remember IBM mainframe 3270 displays ...... :rolleyes:

Robin

If you mean the green display, I didn't have an IBM 3270 but I do fondly remember an IBM PC with hercules card, that super-luminous green may be out-of-gamut on modern displays, I could never quite duplicate it.

I guess you are using vim and syntax highlighting is turned on, to turn it back off, in command mode type:-

:syntax off
1 Like