I want to execute the following command:
lynx -useragent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1' -source 'http://localhost'
as a Process
in Scala. I used both:
val cmd = ... // command to execute
cmd #> new java.io.File( filename ) !
and:
val proc = Process( cmd )
proc !!
And in both cases I get errors from lynx
:
Can't Access `file://localhost/home/me/Work/23.lynx/2.multidownload/(X11;'
Alert!: Unable to access document.
The command run alone works well, when I run it in Scala — I get errors. Which means that something strange happens between Scala and lynx
, and the strings are not interpreted correctly… Any idea?
cmd
? What isfilename
? What isa
?a
was an artifact from vim, and the code was cut-and paste, so I had those strange variables (edited)