I’ve been happily using DrWatson for my latest project, using its convention for filenames. For example, if my simulation uses parameters Dict(:a=>2, :b=>7), my output data file might be named simulation_a=2_b=7.h5.
But now the problem comes when I need to call a shell command from julia with one of these files. For example, I might want to run a shell command that is equivalently given by any of the following three options:
Either the filename itself should be surrounded by exactly one set of single or double quotes or each = should be escaped — not both quotes and escapes, and not two kinds of quoting.
The problem is when I try to make a Cmd to do these things; julia appears to be too clever for me, giving me either no quoting and no escaping, or quoting and escaping. These are some of the options I’ve tried (all of which fail):
Sorry. I misunderstood one of the error messages I was getting:
IOError: could not spawn `h5ls simulation_a=2_b=7.h5`: no such file or directory (ENOENT)
The “file or directory” it’s talking about is not the file I was talking about; it’s the h5ls command. I happened to test these things only with binaries that are in my own PATH, but not whatever run is using.
So yes, this works just fine. Thanks for your help.
julia > cmd = `ffmpeg -f dshow -i video=\"HP HD Camera\" -f rtsp rtsp://127.0.0.1:8554/live`
`ffmpeg -f dshow -i 'video="HP' HD 'Camera"' -f rtsp rtsp://127.0.0.1:8554/live`
Any ideas?
PS
PS: I’m aware of FFMPEG.jl, but I need to keep the pipe open, so I went with a lower-lever approach. Suggestions are welcome.
PPS: Edits are for formatting & typos