[Gambas-user] ec statement with parameters containing spaces

Benoît Minisini gambas at ...1...
Mon Jul 7 16:40:55 CEST 2014


Le 07/07/2014 16:22, John Rose a écrit :
> I have this code:
>       Print "mplex", "-f 8", "-o " & "'" & sCombinedPath & "'", "'" &
> sVideoPath & "'", "'" & sAudioPath & "'"
>       Exec ["mplex", "-f 8", "-o " & "'" & sCombinedPath & "'", "'" &
> sVideoPath & "'", "'" & sAudioPath & "'"] To sOutput
> I'm using the single quotes since they are required when entering the
> equivalent commands in a Terminal e.g. mplex   -f 8    -o
> '/home/john/Videos/q.mpg'    '/home/john/Videos/The Story of Science_
> Power, Proof____20140621_2000.m2v' '/home/john/Videos/The Story of
> Science_ Power, Proof____20140621_2000.mp2'
>
> The Print statement shows (at runtime):
> mplex   -f 8    -o '/home/john/Videos/q.mpg' '/home/john/Videos/The
> Story of Science_ Power, Proof____20140621_2000.m2v'
> '/home/john/Videos/The Story of Science_ Power, Proof____20140621_2000.mp2'
> i.e. the exact equivalent of the working command when entered in a Terminal.
>
> However, the Exec statement does nothing at runtime. There is no
> feedback on why by Gambas. The above sOutput variable has the value "".
> What I am doing wrong?
>

Just that EXEC does *NOT* use any terminal. So there is no quotes or any 
other bash syntax!

-- 
Benoît Minisini




More information about the User mailing list