Home How do I pass commands serially without using pipe through telnet
Reply: 1

How do I pass commands serially without using pipe through telnet

Parker_d Published in 2017-12-07 17:52:24Z

I am doing automation by sending commands through telnet serial port in command line. My question is, I have two telnet ports where I send commands in parallel to each one and copy the result to a text file.

But here is the thing! The commands I pass are in only one session, It's like I am passing the arguments one after another.

For example, I do each step in parallel and then do cat c1 and cat c2:

In telnet 1                        telnet 2

#touch c1                          #touch c2
>cat c1                            >cat c2 

Now after I run cat c1 I get some result in telnet 1 and when I run cat c2, then I get some more result added in c1 and not in c2. I have to copy the cat c1 result to a text file and then run last commands in parallel:

>the                                >the

As you can see after I run touch c1, I don't get # but> which continues.

Can you tell me how to proceed in parallel?

I used a pipe but it didn't work as I don't get result from cat c1 after cat c2 is executed, but I get only cat c1 result.

I may not have explained very clearly, but tried. if anyone can help me out that would be great.

Naidu Reply to 2017-12-07 18:56:57Z

May be you are looking for asynchronous processing of commands. Asynchronous commands execute in parallel.

The command should be terminated with '&', then the shell executes the command in background....


touch c1 & touch c2
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.325699 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO