Sponsored Content
Full Discussion: advanced echo/printf
Top Forums Shell Programming and Scripting advanced echo/printf Post 302362429 by proactiveaditya on Friday 16th of October 2009 04:02:26 AM
Old 10-16-2009
advanced echo/printf

I want to print a colored line using bash. I want to print:

Smtp status [OK]

where "Smtp status" will be in yellow and [OK] will be in green.

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Advanced I/O

What is Stream Devices and Stream pipes? Explain Advanced I/O ? (1 Reply)
Discussion started by: thangappan
1 Replies

2. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

3. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

4. Shell Programming and Scripting

Advanced printf

I want to print: WELCOME TO MY WORLD Where "WELCOME TO MY WORLD" will be in green (32) and the underline will be in yellow (33). How can i do the above using printf. printf "`tput smul`\033 leaves both the text and the underline in green. (3 Replies)
Discussion started by: proactiveaditya
3 Replies

5. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

6. Shell Programming and Scripting

\n in ksh using echo & printf

#!/usr/bin/ksh var1="Hi World" var2="Morning" var3=$(echo "$var1" \n "$var2") echo $var3 var3=$(printf "$var1 \n $var2") echo $var3 Output Any way to get in my $var3 ? (7 Replies)
Discussion started by: dahlia84
7 Replies

7. Shell Programming and Scripting

printf/echo in a second script

This may be little confusing. I have Script1, which pulls data from the system and creates another script(lets say script2). While I run script1 I need to add printf/echo statements for script2, so that when I run script2 I see those statement. eg: script1 765 printf " display frame-$1 timeoffset... (2 Replies)
Discussion started by: miltonrods
2 Replies

8. Shell Programming and Scripting

Managing output... echo or printf?

Hello script guru's as i write more and more code i always block at managing output... either writing to standard out, writing to files via std out (log, temp file, etc). Don't get me wrong 99% of the time it DOES the job but maybe there is more efficient. I'm writing a small script to... (2 Replies)
Discussion started by: maverick72
2 Replies

9. Shell Programming and Scripting

Grep behaves diffrent upon printf or echo output

Hello I want to check whether certain arguments were passed to the script, and when those are, not doing a log entry. If those arguments are not passed, always do a log entry (*new call*). What currently i have is this: echo "${@}"|grep -q \\- || \ tui-log -e "$LOG" "\r---- New call $$... (4 Replies)
Discussion started by: sea
4 Replies

10. Linux

Availability: echo vs. printf?

Hello, For some reason i dont remember, i currently believe (but beeing unsure) that printf is available on more diffrent systems (unix, bsd, linux, ??) than echo is. Could someone please enlighten me, whether this is true or not? Thank you PS: I just found pages about the diffrences of... (3 Replies)
Discussion started by: sea
3 Replies
LIGHTS(1p)						User Contributed Perl Documentation						LIGHTS(1p)

NAME
lights - DNSSEC-Tools Rollover Overview GUI Display SYNOPSIS
lights [options] DESCRIPTION
lights gives a very simple overview of the rollover status of a set of zones. The rollover status counts are given in a "traffic light" display. In contrast, blinkenlights gives a detailed display of the roll status of a set of zones. lights gives very little control over rollerd, the way blinkenlights does. lights can halt rollerd's execution only. The rollover status is retrieved in one of two ways. By default, rollerd is contacted via the rollctl command. Alternately, if the -rrf option is given, then zone status is read directly from a rollrec file. The default method gets the status directly from rollerd and the user need not know the location of the relevant rollrec file. However, that method will not get zone status until rollerd is available to respond to the information request. Consequently, the alternate method allows lights to bypass communicating with rollerd and not having to wait for rollerd to be available. A window is created that has three colored sections - green, yellow, and red. The green section displays a count of those zones that are in "normal" status; that is, they are not in rollover. The yellow section displays a count of those zones that are in rollover. The red section displays a count of those zones that are in need of attention. A common cause for this last state is because a zone is in phase 6 of KSK rollover and is waiting for its parent zone to publish the child's new DS record. Clicking on the color rows in the main window will bring up a dialog box that lists the zones in that state. This list will not automatically update as zones change rollover state. OPTIONS
lights supports the following options. -interval wait-time Interval between checks of zone rollover status By default, wait-time is given in minutes. This can be adjusted by specifying one of the following time-unit suffixes. * s - seconds * m - minutes * h - hours Examples: * -interval 24 - 24 minutes * -interval 24s - 24 seconds * -interval 24m - 24 minutes * -interval 24h - 24 hours -rrf rollrec-file A rollrec file to be read for zone status. -labels Labels will be given for each color field in the GUI. -verbose Give verbose output. -help Give a usage message and exit. -Version Displays the version information for lights and the DNSSEC-Tools package. REQUIREMENTS
lights is implemented in Perl/Tk, so both Perl and Perl/Tk must be installed on your system. KNOWN ISSUES
The following are known issues. These will be resolved in the fullness of time. o Resizing the window leaves the color blobs in their original size. This is an issue with the Tk widget used to display the color stripes. Other display methods are being investigated... COPYRIGHT
Copyright 2010-2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details. AUTHOR
Wayne Morrison, tewok@tislabs.com SEE ALSO
blinkenlights(8), bubbles(8), rollerd(8), rollrec(5) perl v5.14.2 2012-06-21 LIGHTS(1p)
All times are GMT -4. The time now is 01:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy