flua script help


Forum: Programming and Scripting
Topic: flua script help
started by: plinej

Posted by plinej on Feb. 04 2006,23:14
Thanks to mikshaw's flua_reference.uci I've been busy doing some flua scripting. If I have an execute line like the following:

execute("aterm +tr -T md5check -e md5check "..browse.." &>/dev/null")

What do I have to change to make aterm stay open after the script completes this line, instead of closing quickly without being able to read the results?

Posted by mikshaw on Feb. 04 2006,23:20
One way to do it is to run the command in a script instead of directly running the command.  This way you can add a "read" command to the end of the script, which waits for user input before continuing.  For example, your command in flua could be something like this:
Code Sample
execute("aterm +tr -T md5check -e scriptname "..browse)

and the script would look something like this:
Code Sample
#!/bin/sh
md5check $1
read anykey


Another way to do it is to redirect output to a temp file instead of /dev/null, then read that file back into flua.  This would let you do it without needing to have an additional script file.

Posted by plinej on Feb. 04 2006,23:44
Thanks mik! works great.
Posted by andrewb on Feb. 13 2006,01:11
Quote (plinej @ Feb. 04 2006,08:14)
Thanks to mikshaw's flua_reference.uci I've been busy doing some flua scripting. If I have an execute line like the following:

execute("aterm +tr -T md5check -e md5check "..browse.." &>/dev/null")

What do I have to change to make aterm stay open after the script completes this line, instead of closing quickly without being able to read the results?

Where is this UCI available from?
Posted by mikshaw on Feb. 13 2006,03:21
It was in an unofficial repository on a dsl mirror, but that server seems to be gone now.  Most of the scripts i had there can now be found here:
< http://mikshaw.cesparks.com/linux/ >

I have to track down a few of them though, so some of the links are dead for now.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.