Sponsored Content
Top Forums UNIX for Advanced & Expert Users secho substitute echo for your novelty secho.c Post 302342190 by hashi on Friday 7th of August 2009 06:30:43 PM
Old 08-07-2009
secho substitute echo for your novelty secho.c

Code:
/***************************************************************************
 *  secho.c  Copyright (C) 2009 by hashi            NOVELTY WARE           *
 *           unix shell tool substitute for echo "sexy echo"               *
 ***************************************************************************/

/***************************************************************************
 *  yourshell$ cc secho.c -o secho && cp secho <path of executable dir>;   *
 ***************************************************************************/

#define DELAY  15 /* This is the denominator of a fraction of a second. */
                  /* The original is 15 as in 1/15 of a second delay.   */
                  /* Therefore a lower number is slower and zero is     */
                  /* not an option here. A value of one here means      */
                  /* the delay is one second. This would be ridiculous  */
                  /* as such a delay could be scripted and a C program  */
                  /* is a waste of time in this case.                   */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(int argc, char *argv[])
{
        int x=0;
        int y=0;
        int ctr=0;
        char* p=NULL;
        clock_t split=0;
        clock_t cpu_clocks=0;
        if(argc>1){
                for(x=1; x<argc; x++){
                        p=argv[x];
                        if(x>1){
                                putchar(' ');
                                fflush(stdout);
                                ctr++;
                                for(split=0; split<ctr; split=cpu_clocks/(CLOCKS_PER_SEC/DELAY))
                                        cpu_clocks=clock();
                        }
                        for(y=0; y<strlen(p); y++){
                                putchar(*(p+y));
                                fflush(stdout);
                                ctr++;
                                for(split=0; split<ctr; split=cpu_clocks/(CLOCKS_PER_SEC/DELAY))
                                        cpu_clocks=clock();
                        }
                }
                putchar('\n');
        }

  return 0;
}

 

4 More Discussions You Might Find Interesting

1. Linux

Substitute for echo

Hi guys, Is there another function i could use to print out an output beside using echo? (1 Reply)
Discussion started by: hanyou.lin
1 Replies

2. UNIX for Dummies Questions & Answers

Substitute for echo

Hi guys, this there another function i can to print out a line besides echo? (2 Replies)
Discussion started by: hanyou.lin
2 Replies

3. Shell Programming and Scripting

echo substitute sex up ur shell scriptz with secho

/*************************************************************************** * secho.c Copyright (C) 2009 by hashi NOVELTY WARE * * unix shell tool substitute for echo "sexy echo" * ... (1 Reply)
Discussion started by: hashi
1 Replies

4. 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
term::ansi::code::macros(n)					 Terminal control				       term::ansi::code::macros(n)

__________________________________________________________________________________________________________________________________________________

NAME
term::ansi::code::macros - Macro sequences SYNOPSIS
package require Tcl 8.4 package require textutil::repeat package require textutil::tabify package require term::ansi::code::macros ?0.1? ::term::ansi::code::macros::names ::term::ansi::code::macros::import ?ns? ?arg...? ::term::ansi::code::macros::menu menu ::term::ansi::code::macros::frame string _________________________________________________________________ DESCRIPTION
This package provides higher level control sequences for more complex shapes. API
INTROSPECTION ::term::ansi::code::macros::names This command is for introspection. It returns as its result a list containing the names of all attribute commands. ::term::ansi::code::macros::import ?ns? ?arg...? This command imports some or all attribute commands into the namespace ns. This is by default the namespace macros. Note that this is relative namespace name, placing the imported command into a child of the current namespace. By default all commands are imported, this can howver be restricted by listing the names of the wanted commands after the namespace argument. SEQUENCES ::term::ansi::code::macros::menu menu The description of a menu is converted into a formatted rectangular block of text, with the menu command characters highlighted using bold red text. The result is returned as the result of the command. The description, menu, is a dictionary mapping from menu label to command character. ::term::ansi::code::macros::frame string The paragraph of text contained in the string is padded with spaces at the right margin, after normalizing internal tabs, and then put into a frame made of box-graphics. The result is returned as the result of the command. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
ansi, control, frame, menu, terminal COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> term 0.1 term::ansi::code::macros(n)
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy