Hi,
You're right that variables will become handy as you want to do more
complex things. An important thing is to not look too far away: the
usual (immutable) variables are what you need, not the funny (mutable)
interactive strings.
Anyway, the following snippet should help:
$ liquidsoap -
x = get_process_lines("date")
y = get_process_lines("date")
l = list.append(x,y)
print(string.concat(l))
<Ctrl-D>
Sat Aug 22 00:57:01 CEST 2009Sat Aug 22 00:57:01 CEST 2009
No output defined, nothing to do.
The main difference with your earlier scripts is that I used
get_process_lines() instead of system: it returns the process output
as a list of strings, that we store in a variable (namely x, then y).
We also have get_process_output() that returns a single string, but
the one I used removes the newline characters which is useful for you.
In the last two lines of my script, I concatenate the two lists of
length one, and then concatenate the strings of the resulting list of
length two. You can also use more precise functions from our battery
of list operators, notably list.nth(), cf. the reference.
HTH
--
David
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users