 |
|
 |
|
|
 |
help me to find a unix command |
 |
 |
|
|
04-25-07 06:20 AM
hello,
I am sartaj working in ecredit solutions, can some one tell me
what is the command to change the background and foreground color of
command shell in unix.
Thanks & Regards
Sartaj
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
04-25-07 12:19 PM
On 24 Apr 2007 22:58:01 -0700, sartaj123@gmail.com wrote:
> hello,
>
> I am sartaj working in ecredit solutions, can some one tell me
> what is the command to change the background and foreground color of
> command shell in unix.
>
> Thanks & Regards
> Sartaj
Depends of terminal you are using....
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
04-27-07 06:21 PM
<sartaj123@gmail.com> wrote in message
news:1177480681.691882.150640@s33g2000prh.googlegroups.com...
> hello,
> I am sartaj working in ecredit solutions, can some one tell me
> what is the command to change the background and foreground color of
> command shell in unix.
If you are using "xterm", then you can put
XTerm*background: yellow
XTerm*foreground: green
in your ~/.Xdefaults file and when the X server starts up it should read
this file. Resources are also loaded by the xrdb command so if resources are
set by the xrdb command then the .Xdefaults file isn't read. How all this
works is beyond the scope of this posting.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
04-28-07 06:25 AM
sartaj123@gmail.com wrote:
> what is the command to change the background and foreground color of
> command shell in unix.
You can try tput(1), it should work in almost all cases
tput setaf [colornumber] - sets foreground color
tput setab [colornumber] - sets background color
where colornumber is a number from 0 to 9
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-03-07 12:20 PM
On Apr 28, 11:24 am, Tobias Freitag <tfrei...@gmx.net> wrote:
> sartaj...@gmail.com wrote:
>
> You can try tput(1), it should work in almost all cases
>
> tput setaf [colornumber] - sets foreground color
> tput setab [colornumber] - sets background color
>
> where colornumber is a number from 0 to 9
no the above tput command is not working.....
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-03-07 12:20 PM
On 3 May 2007 02:51:39 -0700, sartaj123@gmail.com <sartaj123@gmail.com> wrote:
> On Apr 28, 11:24 am, Tobias Freitag <tfrei...@gmx.net> wrote:
[vbcol=seagreen]
> no the above tput command is not working.....
You need to define "not working" to have any chance of getting help.
Please read this...it's long, but will help you immensely in getting
more out of Usenet:
"How to ask questions the smart way"
http://www.catb.org/~esr/faqs/smart-questions.html
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-04-07 12:21 AM
On 2007-05-03, sartaj123@gmail.com wrote:
> On Apr 28, 11:24 am, Tobias Freitag <tfrei...@gmx.net> wrote:
>
> no the above tput command is not working.....
That's not surprising; the standard for tput does not say anything
about colour. There are many implementations of tput, and they are
not all compatible with each other, and may not have any colour
capabilities.
The standard terminal escape sequences (as defined by ISO-6429 --
formerly ANSI x3.64) are more portable than tput:
black=0
red=1
green=2
yellow=3
blue=4
magenta=5
cyan=6
white=7
fgcolour=$green
bgcolour=$red
printf "\e[3%dm" "$fgcolour" ## set foreground
printf "\e[4%dm" "$bgcolour" ## set background
printf "\e[3%d;4%dm" "$fgcolour" "$bgcolour" ## set both
printf "%s" qwerty ## print something
printf "\e[0m" ## restore defaults
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-10-07 06:20 AM
On May 3, 11:31 pm, "Chris F.A. Johnson" <cfajohn...@gmail.com> wrote:
> On 2007-05-03, sartaj...@gmail.com wrote:
>
>
>
>
>
> That's not surprising; the standard for tput does not say anything
> about colour. There are many implementations of tput, and they are
> not all compatible with each other, and may not have any colour
> capabilities.
>
> The standard terminal escape sequences (as defined by ISO-6429 --
> formerly ANSI x3.64) are more portable than tput:
>
> black=0
> red=1
> green=2
> yellow=3
> blue=4
> magenta=5
> cyan=6
> white=7
>
> fgcolour=$green
> bgcolour=$red
> printf "\e[3%dm" "$fgcolour" ## set foreground
> printf "\e[4%dm" "$bgcolour" ## set background
> printf "\e[3%d;4%dm" "$fgcolour" "$bgcolour" ## set both
> printf "%s" qwerty ## print something
> printf "\e[0m" ## restore defaults
>
> --
> Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
> Shell Scripting Recipes: | My code in this post, if any,
> A Problem-Solution Approach | is released under the
> 2005, Apress | GNU General Public Licence
As you posted the commands(tput) in gmail groups(comp.unix.admin) to
change the color of unix terminal is working for current line, please
help me in changing the color throught out the session of the unix
terminal.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-10-07 12:29 PM
On 9 May 2007 22:20:07 -0700, sartaj123@gmail.com <sartaj123@gmail.com> wrot
e:
> As you posted the commands(tput) in gmail groups(comp.unix.admin) to
> change the color of unix terminal is working for current line, please
> help me in changing the color throught out the session of the unix
> terminal.
1. This isn't a "gmail group".
2. He doesn't owe you a second answer just because he gave you the first
one; your language seems to imply you feel he does.
3. Go read "How to ask questions the smart way" before it's too late:
http://www.catb.org/~esr/faqs/smart-questions.html
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: help me to find a unix command |
 |
 |
|
|
05-10-07 06:28 PM
On 2007-05-10, sartaj123@gmail.com wrote:
> On May 3, 11:31 pm, "Chris F.A. Johnson" <cfajohn...@gmail.com> wrote:
[please trim signatures]
[vbcol=seagreen]
> As you posted the commands(tput) in gmail groups(comp.unix.admin)
This is not a gmail group, nor a Google group; it is a usenet
newsgroup.
> to change the color of unix terminal is working for current line,
> please help me in changing the color throught out the session of the
> unix terminal.
Read the man page for the terminal you are using; you can set the
colours with arguments on the command line or in Xresources (load
or merge changes with xrdb).
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 06:19 PM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
Medical and Health forum | Computer Games Reviews | Graphics design forum
|
 |
|
 |
|