TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource > Unix

Notices

BASH SHELL : colors & watch command

Unix


Reply
 
Thread Tools Display Modes
Old 16-11-2007, 03:31 PM   #1
DeM Zed
Guest
 
Posts: n/a
BASH SHELL : colors & watch command

Hi,

I use watch command to execute a monitoring script "probe.sh"

probe uses colors like this one
echo -e "\e[5;31mWARNING\e[0m"

This is correctly printed using probe.sh, but not while using "watch
rpobe.sh".

Any idea ?

Thanks !
  Reply With Quote
Old 17-11-2007, 04:35 AM   #2
Chris F.A. Johnson
Guest
 
Posts: n/a
Re: BASH SHELL : colors & watch command

On 2007-11-16, DeM Zed wrote:
>
>
> Hi,
>
> I use watch command to execute a monitoring script "probe.sh"
>
> probe uses colors like this one
> echo -e "\e[5;31mWARNING\e[0m"
>
> This is correctly printed using probe.sh, but not while using "watch
> rpobe.sh".


man watch:

BUGS
...
Non-printing characters are stripped from program output. Use
"cat -v" as part of the command pipeline if you want to see
them.



--
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
  Reply With Quote
Old 20-11-2007, 11:46 AM   #3
DeM Zed
Guest
 
Posts: n/a
Re: BASH SHELL : colors & watch command

I don't understand this cat -v.
Can you show me an example ?

On 16 nov, 23:38, "Chris F.A. Johnson" <> wrote:

> manwatch:
>
> BUGS
> ...
> Non-printing characters are stripped from program output. Use
> "cat -v" as part of thecommandpipeline if you want to see
> them.
>

  Reply With Quote
Old 20-11-2007, 11:46 AM   #4
Chris F.A. Johnson
Guest
 
Posts: n/a
Re: BASH SHELL : colors & watch command

On 2007-11-19, DeM Zed wrote:
> On 16 nov, 23:38, "Chris F.A. Johnson" <> wrote:
>
>> man watch:
>>
>> BUGS
>> ...
>> Non-printing characters are stripped from program output. Use
>> "cat -v" as part of the command pipeline if you want to see
>> them.
>>


[please don't top post]

> I don't understand this cat -v.


It is non-standard. See this excerpt from the POSIX spec:

Historical versions of the cat utility include the options -e,
-t, and -v, which permit the ends of lines, <tab>s, and
invisible characters, respectively, to be rendered visible in
the output.

--
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
  Reply With Quote
Old 20-11-2007, 11:46 AM   #5
DeM Zed
Guest
 
Posts: n/a
Re: BASH SHELL : colors & watch command

I don't understand this cat -v.
Can you show me an example ?

On 16 nov, 23:38, "Chris F.A. Johnson" <> wrote:

> manwatch:
>
> BUGS
> ...
> Non-printing characters are stripped from program output. Use
> "cat -v" as part of thecommandpipeline if you want to see
> them.
>

  Reply With Quote
Old 20-11-2007, 11:46 AM   #6
Chris F.A. Johnson
Guest
 
Posts: n/a
Re: BASH SHELL : colors & watch command

On 2007-11-19, DeM Zed wrote:
> On 16 nov, 23:38, "Chris F.A. Johnson" <> wrote:
>
>> man watch:
>>
>> BUGS
>> ...
>> Non-printing characters are stripped from program output. Use
>> "cat -v" as part of the command pipeline if you want to see
>> them.
>>


[please don't top post]

> I don't understand this cat -v.


It is non-standard. See this excerpt from the POSIX spec:

Historical versions of the cat utility include the options -e,
-t, and -v, which permit the ends of lines, <tab>s, and
invisible characters, respectively, to be rendered visible in
the output.

--
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
  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 12:38 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional