What the heck, it's Friday let's drive some people nuts. - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: What the heck, it's Friday let's drive some people nuts. (/showthread.php?tid=3137) |
What the heck, it's Friday let's drive some people nuts. - doppler - 10-18-2024 I want to automate some commands in a CMD window. I need to capture output and input "only from that window" (text only in this case). I expect this would require a third party program to help me. My problem: I need to repeatedly send commands to Raspberry PI's on my network. I can use SSH to remotely send commands to each PI. I can even automate some keystrokes using AUTOHOTKEY. But all this is repetitive. Very boring and time consuming. I am by nature lazy as f*ck. The torturous part it's not as simple to sending a one line ssh command. I may want to do more than one thing in that window. All requiring input and outputs, of various natures. Why reinvent that wheel. When I am almost 100% sure someone here already found that wheel and is using it. Care to share ? Thanks. RE: What the heck, it's Friday let's drive some people nuts. - dano - 10-20-2024 I use AutoHotKey a LOT in my work to do exactly this. In my case I use QB64pe to comb through incoming data, then create the logic that needs to be performed, and then QB64pe writes the .AHK script and launches it via the shell command. It works very well and is reliable when written properly. RE: What the heck, it's Friday let's drive some people nuts. - TDarcos - 10-20-2024 (10-18-2024, 10:41 AM)doppler Wrote: I want to automate some commands in a CMD window. I need to capture output and input "only from that window" (text only in this case).Well, in the MSDOS window of Windows 95 and up, you could run a command of dosomething.exe arg1 "argument 2" arg3 >results.lst so putting that command in a QB64 SHELL command, then read that results.lst file. On Linux you use the same type of command sequence. If I am misunderstanding you, please give more details. "Well there must be some misunderstanding." - Phil Collins RE: What the heck, it's Friday let's drive some people nuts. - doppler - 10-20-2024 The problem with AutoHotKey. It's only a keyboard spewer with no feedback. Need to tweak wait commands for things not keyboard queue-able, especially dealing with drop down windows. So input and output timing can not be controlled. I automate autohotkey commands to send things. But I need to be the commander at the keyboard and select the windows. Using dos piping (ie: < and >) is only usable until you do it. If I use "ssh" command in a cmd batch, all is well until ssh program executes. Then the batch execution point suspends until I exit ssh. To proceed after the batch ssh command line. So it's good to get me into ssh, but no more automation when it starts. This was really a PIE-IN-THE-SKY expectation. Thought might be a magician out there who could work there VooDoo. RE: What the heck, it's Friday let's drive some people nuts. - SpriggsySpriggs - 10-21-2024 So pipecom can be fitted to do STDIN but I have not looked at it in a long time. With that, you'd be able to grab STDOUT as well, which should effectively make the window interactive. I'd have to find my latest code somewhere. Not sure where it is anymore. |