Visit Our UNIX and Linux User Community


echo substitute sex up ur shell scriptz with secho


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting echo substitute sex up ur shell scriptz with secho
# 1  
Old 08-07-2009
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" *
***************************************************************************/

/***************************************************************************
* 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;
}
# 2  
Old 08-07-2009
This is no publication platform for your C-programs. This is a board where people ask for help. Also when posting something like this, put it to the correct area like High Level Programming and not into Shell Scripting.
Also nobody asked for you "enhanced" echo.

Also start using CODE-tags if you post code, data or logs.

Thread closed!

Previous Thread | Next Thread
Test Your Knowledge in Computers #353
Difficulty: Medium
mawk is a very fast AWK implementation by Mike Brennan based on a Python interpreter.
True or False?

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script: substitute value in text file

Hi gurus, I need help with shell script. I have various INSERT queries which inserts data into database. I want to insert 3rd column data into newline for one particular table. I have very time long txt file everytime and it have various INSERT/UPDATE queries but i have to done with it only one... (8 Replies)
Discussion started by: mirfan
8 Replies

2. UNIX for Advanced & Expert Users

secho substitute echo for your novelty secho.c

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

3. 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

4. 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

5. UNIX for Dummies Questions & Answers

how to write perl substitute command in shell scripts

How to write perl substitute command in shell script without invoking a perl script file seperately. for ex: shell script to relace IT with CSC in a file using perl substitute command. (3 Replies)
Discussion started by: param_it
3 Replies

Featured Tech Videos