Sponsored Content
Full Discussion: uisng color in script...
Top Forums Shell Programming and Scripting uisng color in script... Post 56164 by moxxx68 on Tuesday 28th of September 2004 07:52:27 PM
Old 09-28-2004
MySQL dear Zazzybob...

Smilie found the answer.. couldn't quite figure .bashrc or alias and i am sure there is a more functional way of writing this into the script if you or anyone has some ideas about a way to implement it in a function or know how to apply the alias code to the script I would really like to hear from you.. i tried ot implement both but didn't get far.. but this seems to work just fine;;;
# !/bin/sh
# .clear
function fun { clear; pwd; date; tty; }
TTY=`tty`
Dir=`dir`
echo "enter term:"
read term
if [ "$TTY" == "/dev/pts/$term" ]
then
fun
echo "Experimental Tterminal" > /dev/pts/$term
elif [ "$term" == "z" ]
then
fun
echo "Experimental Terminal"
ls -ali --color > /dev/tty
elif [ "$term" == "usb" ]
then
fun
echo "//Usbterminal//" > /dev/tty
ls -ali --color
else
fun
case $term in
u|U) fun
echo "//usbterminal//" && egrep -nA5 '([a-z]|[0-9]\Smilie' * | less && ls -ali --color > /dev/tty
;;
e|E) fun
echo "Experimental Terminal" && egrep -nA5 '([a-z]|[0-9]\Smilie' * | less && ls -ali --color > /dev/tty
;;
a|A) fun
egrep -nA5 '([a-z]|[0-9])' * | less && ls -ali --color > /dev/tty
;;
x|X) fun
xterm & > /dev/tty
;;
m|M)fun
mozilla & > /dev/tty
;;
esac
fi

thanx for your input and appreciate your interest.
moxxx68
Smilie
just one question !
this function just gives esc sequences instead of color why...?
ls -ali -R --color | less....

Last edited by moxxx68; 09-28-2004 at 09:25 PM..
 

3 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Find command uisng -prune or -only

I've run into a brick wall using the -prune command to avoid walking sub-directories. Does any one have any suggestions on how I avoid walking the sub-directories when finding files in the following example? I want to find all files older than 30 days in the dir1 directory and only the dir1... (7 Replies)
Discussion started by: 2reperry
7 Replies

2. AIX

How to backup and restore Linux uisng NIM.

Hi Friends, I've a hard question to ask. I have a NIM server running on AIX 5.3. Now my requirement is that , " From This NIM Server i would like to take the Image of Linux servers ". I mean that using NIM server i should be able to backup / restore the linux Servers. In Simple terms... (3 Replies)
Discussion started by: rdkumarj
3 Replies

3. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies
vga_setrgbcolor(3)						Svgalib User Manual						vga_setrgbcolor(3)

NAME
vga_setrgbcolor - set the current color SYNOPSIS
#include <vga.h> void vga_setrgbcolor(int r, int g, int b); DESCRIPTION
Set the current color to RGB values r, g, and b, each in the range 0-255. Does not make sense in 256 or less color modes. Use vga_set- color(3) there. The color is used by vga_drawpixel(3) and vga_drawline(3). The fun(6) and vgatest(6) demos show the basic use of this function. SEE ALSO
svgalib(7), vgagl(7), libvga.config(5), fun(6), vgatest(6), vga_drawpixel(3), vga_drawline(3) AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The exact source of the referenced function as well as of the original documentation is unknown. It is very likely that both are at least to some extent are due to Harm Hanemaayer <H.Hanemaayer@inter.nl.net>. Occasionally this might be wrong. I hereby asked to be excused by the original author and will happily accept any additions or corrections to this first version of the svgalib manual. Svgalib (>;= 1.2.11) 27 July 1997 vga_setrgbcolor(3)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy