- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- script with colors
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2003 11:56 AM
тАО06-06-2003 11:56 AM
script with colors
How can i write with color in perl or some shell in linux (RH 7.2 or high).
Which command or modules can help?
Thk
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2003 12:28 PM
тАО06-06-2003 12:28 PM
Re: script with colors
and for debugging... emacs.
hth
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2003 12:50 PM
тАО06-06-2003 12:50 PM
Re: script with colors
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2003 01:33 PM
тАО06-06-2003 01:33 PM
Re: script with colors
sorry Caesar for misunderstanding. What you need is the curses and ncurses function in your script.
man these functions or look at this howto about ncurses, the new curses. Notice that it exists both for shell & perl :
http://www.linux.org/docs/ldp/howto/NCURSES-Programming-HOWTO/
hth
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2003 12:50 PM
тАО06-16-2003 12:50 PM
Re: script with colors
I've found this. Try it, i think is what you want.
You can found more information at:
http://www.freeos.com/guides/lsst/
Cheers Frank.
#!/bin/bash
#
# Linux Shell Scripting Tutorial 1.05r3, Summer-2002
#
# Written by Vivek G. Gite
#
# Latest version can be found at http://www.nixcraft.com/
#
# Q16
# echo command with escape sequance to give differnt effects
#
# Syntax: echo -e "escape-code your message, var1, var2 etc"
# For eg. echo -e "\033[1m Hello World"
# | |
# | |
# Escape code Message
#
clear
echo -e "\033[1m Hello World"
# bold effect
echo -e "\033[5m Blink"
# blink effect
echo -e "\033[0m Hello World"
# back to noraml
echo -e "\033[31m Hello World"
# Red color
echo -e "\033[32m Hello World"
# Green color
echo -e "\033[33m Hello World"
# See remaing on screen
echo -e "\033[34m Hello World"
echo -e "\033[35m Hello World"
echo -e "\033[36m Hello World"
echo -e -n "\033[0m "
# back to noraml
echo -e "\033[41m Hello World"
echo -e "\033[42m Hello World"
echo -e "\033[43m Hello World"
echo -e "\033[44m Hello World"
echo -e "\033[45m Hello World"
echo -e "\033[46m Hello World"
echo -e "\033[0m Hello World"
# back to noraml
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2003 04:39 PM
тАО06-16-2003 04:39 PM
Re: script with colors
Caeser, welcome to the wonderful world of ANSI Escape sequences!
It's truely quite remarkable what you can do with these silly things (I remember re-mapping CTRL-C using ANSI.SYS on old DOS 5 systems!), but it all goes down to terminal emulation requirements.
If you are using a VT220 terminal, or emulation, you'll have issues with using ANSI color sequences.
But as you'll most probably be using some emulator that does ANSI anyway (as it's extremely widely used, and a number of other emulation types use a subset of it's sequences), you shouldn't have too many issues.
Strangely enough, if you look in the "Bash-Prompt-HOWTO" (section 6 - http://www.ibiblio.org/mdw/HOWTO/Bash-Prompt-HOWTO/), you'll find quite a few details on what you can do with your shell.
Have fun.. ;)