Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* setcolor equivalent
@ 2000-08-21 14:57 Ron West
  2000-08-21 15:47 ` Jeff Sturm
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ron West @ 2000-08-21 14:57 UTC (permalink / raw)
  To: 'axp-list@redhat.com'

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

We are porting our applications over from SCO Unix to Linux.  Our user
applications are not written to take advantage of the GUI, but are all Borne
or Korn shell scripts executing from the command line.  One command that
executes from the .profile is the SCO setcolor command which changes the
forground and background colors of the user's screen.  I (a new Linux admin)
have looked everywhere for an equivalent command, but have found nothing, no
referrences to anything other than DIR_COLOR which isn't what we want.  Is
there a way to do this?  I simply want to color the screen at the Borne
shell blue with white characters.

Thanks,
Ron West

[-- Attachment #2: Type: text/html, Size: 1083 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
@ 2000-08-21 15:19 Phil Carmody
  0 siblings, 0 replies; 8+ messages in thread
From: Phil Carmody @ 2000-08-21 15:19 UTC (permalink / raw)
  To: axp-list

On Mon, 21 August 2000, Ron West wrote:
> <P><FONT SIZE=2 FACE="Arial">We are porting our applications over from SCO Unix to Linux.  Our user applications are not written to take advantage of the GUI, but are all Borne or Korn shell scripts executing from the command line.  One command that executes from the .profile is the SCO setcolor command which changes the forground and background colors of the user's screen.  I (a new Linux admin) have looked everywhere for an equivalent command, but have found nothing, no referrences to anything other than DIR_COLOR which isn't what we want.  Is there a way to do this?  I simply want to color the screen at the Borne shell blue with white characters.</FONT></P>



I'm guessing here, but I suspect it will be tricky.

Does DIR_COLOR work for setting colours for an ls?
If so, look at the source for ls, and see how it changes the colours. It's probably something in the termcap, i.e.  terminal-type specific escape characters. Maybe you could find the excape sequences used in the termcap file if you know your terminal type is "linux" or similar?

Are you never expecting people to run these from within the X windowing system? If not (i.e. they might use X) why do you want to override the users' own color preferences. As a colour-deficient computer user I find that other people's choices can be nighmarish.


Phil

Judge Lewis Kaplan's idiocy finally proved August 17, 2000:
"Defendants, on the other hand, are adherents of a movement
that believes that information should be available without
charge to anyone clever enough to break into the computer
systems or data storage media in which it is located."

_______________________________________________________________________

Free Unlimited Internet Access! Try it now! 
http://www.zdnet.com/downloads/altavista/index.html

_______________________________________________________________________




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
  2000-08-21 14:57 Ron West
@ 2000-08-21 15:47 ` Jeff Sturm
  2000-08-21 15:48   ` Jeff Sturm
  2000-08-21 16:18 ` Michal Jaegermann
  2000-08-22 13:30 ` Peter Rye
  2 siblings, 1 reply; 8+ messages in thread
From: Jeff Sturm @ 2000-08-21 15:47 UTC (permalink / raw)
  To: axp-list

Foreground:

  tput setf [0-7]

Background:

  tput setf [0-7]

Reset to defaults:

  tput sgr0

Ron West wrote:
> We are porting our applications over from SCO Unix to Linux.  Our user
> applications are not written to take advantage of the GUI, but are all Borne
> or Korn shell scripts executing from the command line.  One command that
> executes from the .profile is the SCO setcolor command which changes the
> forground and background colors of the user's screen.  I (a new Linux admin)
> have looked everywhere for an equivalent command, but have found nothing, no
> referrences to anything other than DIR_COLOR which isn't what we want.  Is
> there a way to do this?  I simply want to color the screen at the Borne shell
> blue with white characters.

--
Jeff Sturm
jeff.sturm@appnet.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
  2000-08-21 15:47 ` Jeff Sturm
@ 2000-08-21 15:48   ` Jeff Sturm
  2000-08-21 16:01     ` Reinier Bikker
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Sturm @ 2000-08-21 15:48 UTC (permalink / raw)
  To: axp-list

Jeff Sturm wrote:
> Background:
> 
>   tput setf [0-7]

Oops, that'd be "tput setb ..."

--
Jeff Sturm
jeff.sturm@appnet.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
  2000-08-21 15:48   ` Jeff Sturm
@ 2000-08-21 16:01     ` Reinier Bikker
  0 siblings, 0 replies; 8+ messages in thread
From: Reinier Bikker @ 2000-08-21 16:01 UTC (permalink / raw)
  To: axp-list

Another option is to use escape codes. This makes it possible to change
colors within a line of output. Below is the classic example which shows
their usage.


#!/bin/bash
# colorscript: Display ANSI colours.
#
esc="\033["
echo -n " _ _ _ _ _40 _ _ _ 41_ _ _ _42 _ _ _ 43" 
echo "_ _ _ 44_ _ _ _45 _ _ _ 46_ _ _ _47 _"
for fore in 30 31 32 33 34 35 36 37; do
  line1="$fore  " 
  line2="    "
  for back in 40 41 42 43 44 45 46 47; do
    line1="${line1}${esc}${back};${fore}m Normal  ${esc}0m"
    line2="${line2}${esc}${back};${fore};1m Bold    ${esc}0m"
  done
  echo -e "$line1\n$line2"
done


Reinier.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
  2000-08-21 14:57 Ron West
  2000-08-21 15:47 ` Jeff Sturm
@ 2000-08-21 16:18 ` Michal Jaegermann
  2000-08-22 13:30 ` Peter Rye
  2 siblings, 0 replies; 8+ messages in thread
From: Michal Jaegermann @ 2000-08-21 16:18 UTC (permalink / raw)
  To: axp-list

> 
> We are porting our applications over from SCO Unix to Linux.

This will be Linux on Alpha, I take, or you would not be posting on this
list?

> I simply want to color the screen at the Borne
> shell blue with white characters.

From the context I understand that you are talking about Linux console?
Try (this is 'echo' from bash):

echo -en "\\033[1;1;44m"
echo -n and now for something totally
echo -en "\\033[0;39m"
echo " different"

In general for things like that consult Keyboard-and-Console-HOWTO.
If you just want boxes with a colour on a console type 'man dialog'
and see examples which come with it.

So where is this Alpha question?

  Michal




^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: setcolor equivalent
@ 2000-08-21 16:58 Ron West
  0 siblings, 0 replies; 8+ messages in thread
From: Ron West @ 2000-08-21 16:58 UTC (permalink / raw)
  To: 'axp-list@redhat.com'

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]

I want to thank everyone that responded to my shell color questions.  We now
have a blue screen with white characters.

Ron West

[-- Attachment #2: Type: text/html, Size: 513 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: setcolor equivalent
  2000-08-21 14:57 Ron West
  2000-08-21 15:47 ` Jeff Sturm
  2000-08-21 16:18 ` Michal Jaegermann
@ 2000-08-22 13:30 ` Peter Rye
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Rye @ 2000-08-22 13:30 UTC (permalink / raw)
  To: axp-list

>>>>> "Ron" == Ron West <ron@pacificrimcorp.com> writes:

    Ron> We are porting our applications over from SCO Unix to Linux.  Our
    Ron> user applications are not written to take advantage of the GUI,
    Ron> but are all Borne or Korn shell scripts executing from the command
    Ron> line.  One command that executes from the .profile is the SCO
    Ron> setcolor command which changes the forground and background colors
    Ron> of the user's screen.  I (a new Linux admin) have looked
    Ron> everywhere for an equivalent command, but have found nothing, no
    Ron> referrences to anything other than DIR_COLOR which isn't what we
    Ron> want.  Is there a way to do this?  I simply want to color the
    Ron> screen at the Borne shell blue with white characters.

Does `setterm -background "whatever" -store' do what you want?
man setterm gives details as usual.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2000-08-25 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-21 15:19 setcolor equivalent Phil Carmody
  -- strict thread matches above, loose matches on Subject: below --
2000-08-21 16:58 Ron West
2000-08-21 14:57 Ron West
2000-08-21 15:47 ` Jeff Sturm
2000-08-21 15:48   ` Jeff Sturm
2000-08-21 16:01     ` Reinier Bikker
2000-08-21 16:18 ` Michal Jaegermann
2000-08-22 13:30 ` Peter Rye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox