Running a multiline shell command

Bob Sneidar bobs at
Fri Dec 9 21:50:27 EST 2011

This has been discussed before, but I am trying to run multiple lines of shell commands using the shell() function. It looked like it worked at first, only the telnet session dumped me before I could get any information out of the switch. Now it looks like I am not even talking to the shell anymore. The shell script looks like this:

script "/users/shared/macaddresses.txt"
print "show mac-address"

script off

I have this in a stack property, and put it into a variable. I replace theUser and thePassword with the actual credentials before running shell(). The result is empty. I have executed the above commands line by line in a terminal and I do end up with a file with the output of the shell window as neat as you please. But when I try to execute within Livecode using the shell() function I get squadouche. 

The goal is to get the mac address table from a Procurve managed switch. Any ideas?


More information about the Use-livecode mailing list