[Gambas-user] Shell command including string containing a quote

John Rose john.aaron.rose at ...626...
Thu Jan 24 18:59:50 CET 2013


I have written a GUI to execute a command which involves selecting 
filenames (e.g. sCombinedPath below) to be used in a Shell command (as 
part of a Process). It works OK generally. However, if any filename 
includes a quote, it goes wrong.

sCommand = "mplex -f 8 -o " & "'" & sCombinedPath & "' " &
                                 "'" & sVideoPath & "' " &
                                 "'" & sAudioPath & "' " &
                                 ">/dev/null 2>'" & sLogFilename & "'"
   Print sCommand
   hProcess = Shell sCommand

I read about using the Shell$ command to create a quoted string but I 
couldn't make that work. I've also tried a Replace$ command to replace a 
quote by a backslash followed by a quote. I couldn't get that to work.

Any ideas please?

Project attached.

-- 
Regards,
John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CombineAV.tar.gz
Type: application/x-gzip
Size: 14720 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130124/10f6984b/attachment.bin>


More information about the User mailing list