[SATLUG] Add line or character delay to ssh session

c P sargonemail at gmail.com
Tue Sep 7 20:22:32 CDT 2010


> On Tue Sep 7 17:26:29 CDT 2010, travis+ml-satlug at subspacefield.org wrote:
> > On Tue, Sep 07, 2010 at 12:34:07PM -0500, Aaron Hackney wrote:
> > > On Tue, Sep 7, 2010 at 11:54 AM, c P <sargonemail at gmail.com> wrote:
> > > Well, under a unix shell, you can always paste to a file, then feed
>
> cat | delay_script | ssh router
What's in the delay_script?
>
> BTW, the suggested awk script seemed to lack any delays.
>

The Red Hat command after is the only unix command line program that will delay
for less than 1 second (otherwise, you need to roll your own command
line timming program)
In the awk script, a system call is made to the after command with a
command line
paramenter of 30 (a delay of 30 milliseconds).  ->
system(sprintf("after %d", naptime))
It does delay 30ms * number of lines processed. :P
What it lacks, is a print statement for the current line being
processed, when the system
call returns from the 30ms delay.
cat file | awk '{if (system(sprintf("after %d", 30)) != 0)  exit 1 ; print $0}'

Ideally, you could just change the baud settings of the local tty to
be the same or less
of the receiving tty.


More information about the SATLUG mailing list