PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → ExeRun balks at redirect to file on linux
ExeRun balks at redirect to file on linux
Iniciado por tony.turner, 19,may. 2015 17:43 - 1 respuesta
Publicado el 19,mayo 2015 - 17:43
Hi,

I want to use ExeRun on linux but redirect the result of the command to file normally using > myFile.txt.

Now if I run this from the linux command prompt it works fine:

/usr/bin/xe vm-snapshot uuid=c1b56dfa-c614-4a19-5a86-c257b81d6fc9 new-name-label=20150519162255170 > text.txt

no errors

[root@xen5 ~]# /usr/bin/xe vm-snapshot uuid=c1b56dfa-c614-4a19-5a86-c257b81d6fc9 new-name-label=20150519162255170 > text.txt
[root@xen5 ~]#

text.txt has uuid

[root@xen5 ~]# cat text.txt
d5d519d3-71c4-b634-29d1-87985a76b578

From RunExe

myres = ExeRun("/usr/bin/xe vm-snapshot uuid=" + Replace(CommandLine(2)," ","",IgnoreCase) + " new-name-label=" + Timestamp+ " > text.txt")

[root@xen5 ~]# ./vm-control backup c1b56dfa-c614-4a19-5a86-c257b81d6fc9
Error: Unknown field '>'

Anyway to stop ExeRun complaining about the redirect to file "> text.txt"

Thanks

Tony
Publicado el 19,mayo 2015 - 23:39
Do we have anything in Windev that can read the console after calling ExeRun on linux

When I use ExeRun the program called returns a uuid.

Now Python I can read the return from console can Windev?

this is python
cmd = "xe vm-snapshot uuid=" + uuid + " new-name-label=" + timestamp
snapshot_uuid = commands.getoutput(cmd)

Do we have a function in Windev that can read the console to see what the exe returns. i.e the uuid

the result for RunExe is boolean but this actually returns a uuid which I need on the next function of my program
can windev retrieve the returned uuid from console. I see the uuid and 0 or 1 returned via Windev as result

myres = ExeRun("/usr/bin/xe vm-snapshot uuid=" + Replace(CommandLine(2)," ","",IgnoreCase) + " new-name-label=" + Timestamp,exeActive,exeReturnValue)


You can see here I get a uuid on consaole as a return can Windev read that uuid

[root@xen5 ~]# ./vm-control backup c1b56dfa-c614-4a19-5a86-c257b81d6fc9
80eb37f3-9dea-73d2-3e73-7e48501b64cb

Thanks

Tony