Re: Running a multiline shell command

2011-12-13 Thread Bob Sneidar
Oh interesting. I've been suspecting it was the particular shell that Livecode uses by default (I learned that from prior posts). Also, does using variables like that mask the actual username and password in the shell window? the downside to my method is that it opens a new shell window and then

Re: Running a multiline shell command

2011-12-13 Thread Bernard Devlin
How about if you set the shellCommand so that instead of pointing to "/bin/sh" it points to "/bin/tcsh", or even have the shellCommand set to point to "/usr/bin/telnet" itself. There are definitely some oddities with OS X and line endings (I seem to remember Mark Schonewille explaining it to me so

Re: Running a multiline shell command

2011-12-12 Thread Bob Sneidar
I may have figured a *hack* way around this, at least when doing a redirected output to a file: repeat with i = 1 to 10 put the detailed files into theFileList filter theFileList with "*scanout.txt*" if theFileList is empty then wait one second with messag

Re: Running a multiline shell command

2011-12-12 Thread Mike Bonner
I suspect the behavior you are seeing is because telnet acts like its own shell process, and isn't displaying to stdout of the shell that starts it, but rather is talking to itself. Unlike stuff like grep/etc that display to stdout of the calling shell. Hence seeing the stuff before, and the stuff

Re: Running a multiline shell command

2011-12-12 Thread Bob Sneidar
Well I determined that whatever Livecode is using on a Mac is what the shell expects for newline characters. I determined this by manually replacing all newlines in the property inspector (where I keep the shell code) with whatever the return key produces. I then copied the value from the proper

Re: Running a multiline shell command

2011-12-12 Thread Bob Sneidar
I am using Snow Leopard. Yes there is an expect command. I just read the man page for it. WOW! There is a lot there. From what I gather, I can create a file that contains all the responses I will be presented with, and expect will respond to those prompts accordingly. Now I did succeed once in

Re: Running a multiline shell command

2011-12-10 Thread Mark Wieder
Bob- Friday, December 9, 2011, 6:50:27 PM, you wrote: > The goal is to get the mac address table from a Procurve managed switch. Any > ideas? What OS? Do you have an "expect" command available? -- -Mark Wieder mwie...@ahsoftware.net ___ use-livec

Re: Running a multiline shell command

2011-12-10 Thread Mike Bonner
Could also go the open process route. put "telnet youripdaddress" into tProcess open process tProcess for update -- not real code, just quicky pseudo read from the process until you get the username prompt write theusername & return to process tProcess read from process until yuo get the username p

Re: Running a multiline shell command

2011-12-10 Thread Bernard Devlin
Could it be an issue with the "return" character? As you know, they are different on each platform. You could try variations between ascii 10 and 13. If you have it working as a script on your file system, you could try putting that script into a custom property (get hold of it using a binfile U