Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

just to echo text wiat, echo some more

Status
Not open for further replies.

Cadwalader

IS-IT--Management
Feb 12, 2002
297
US
I need to make a file that when run, it just echos text, and can wait a few seconds. I need it to spit out a line, go to a new line, spit out some more, wait, then spit out another few lines, etc. like when you're booting a kernal.
Different colors and stuff would be nice too.

I don't know what language to use, I was trying to bet a .bat file to do it, but we all know how limited Winblow$ is. I need something easy to learn...but I have no idea where to start.

Anyway, why the heck and I trying to do this? To impress a geek chick I met. :)

Hope I was of some help...
--OR--
Thanks for the help...
--Rich

 
You could do something like this:
for i in `cat filetodisplay`
do
echo $i
wait 5
done
 
thanks, I found a site that covers some of what I want to do, but there are two things I want to do that I can't figure out:

change the font color
make the lines print one character at a time on the same line...
can I do that by just going liek this?

echo "H" sleep 1 echo "e" sleep 1 echo "l" sleep 1 echo "o"
to print Hello on the screen one character at a time?

the font color thing would be cool though ;)
I've got it waiting and spitting out lines of text already... Hope I was of some help...
--OR--
Thanks for the help...
--Rich

 
use tput cpu row column to position the cursor at a specific point on the screen:
tput cup 10 1
echo "h"
sleep 1
tput cup 10 2
echo "i"
 
OK, how do I get this:

while :)); do echo -n . && sleep 1;done

to stop after like 5 seconds? Hope I was of some help...
--OR--
Thanks for the help...
--Rich

 
set count = 1
while ($count < 6)
...do something ...
sleep 1
@ count = $count + 1
end
 
if that doesnt work , try this

count=0
while [ $count -lt 5 ]
..do something..
sleep 1
count=`expr $count + 1`
done
 
If you want to run a small script to echo data you first need to declare your shell that you want the script to run in.

My suggestion is bash.

&quot;echo&quot; is a command that will echo anything after that command.

(Example)

echo how are you?

you would get at the command line _ how are you?


so edit a new file and declare your shell first. Than echo out what you want. This is the most basic of commands. I will give you an example and if it helps good on you.


#!/bin/bash

echo &quot;whatever you want here to be echoed&quot;
echo &quot;continue with your text&quot;


Let's say you called this script text.sh
when you make the file executable and ran it you would get this on your screen

&quot;whatever you want here to be echoed&quot;
&quot;continue with your text&quot;

Good luck.
 
Thanks for all the help. And not yet, I didn't show her. I'll show her this Saturday (IF I can get my laptop fixed by then, the screen hinge is wore out again). I'll let you all know what she thinks of it. ;) Hope I was of some help...
--OR--
Thanks for the help...
--Rich

 
Well, she loved it. She has never seen a UNIX screen before. She didn't know that a command line could be so interactive. She watched it run again on Sunday, and again on Monday morning...I think she really liked it. Thanks for the everyone. It really paid off [thumbsup2] Hope I was of some help...
--OR--
Thanks for the help...
--Rich

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top