Ed_P wrote:I have a script that invokes Firefox with a URL that Firefox rejects because the script passes the URL misformed. How do I get the script to pass what I give it?
Code: Select all
firefox "/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF" 2>/dev/null &
exit 0
Code: Select all
File not found
Firefox can't find the file at /mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF.
And the reason is the URL in the URL field is:
Code: Select all
file:///mnt/sda5/Users/Ed/My%20Webpages/EdsxoapWeatherData.html%3Fb=FF
If I manually change the %3F back to ? or manually paste the URL into FireFox's URL field it works fine.
Hi
Ed_P
My script is not to do with FF, but with splitting up big movie files for the cloud.
Ed_P wrote:
In that the echos work OK I'm leaning more toward this being a Linux/Porteus FireFox problem.
Also of that opinion.
Looks like we've been going round the houses. This is URL format:
Code: Select all
file:///mnt/sda5/Users/Ed/My%20Webpages/EdsxoapWeatherData.html%3Fb=FF
This is same URL
decoded:
Code: Select all
file:///mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF
Yesterday tried:
Code: Select all
guest@porteus:~$ ff='/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF'
guest@porteus:~$ echo $ff
/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF
firefox $ff
FF decided to create a URL like so:
http://www.mnt.com/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF
Today did:
Code: Select all
guest@porteus:~$ ff='/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF'
guest@porteus:~$ echo $ff
/mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF
guest@porteus:~$ firefox "$ff"
and got something else:
Code: Select all
file:///mnt/sda5/Users/Ed/My%20Webpages/EdsxoapWeatherData.html%3Fb=FF
File not found
Firefox can't find the file at /mnt/sda5/Users/Ed/My Webpages/EdsxoapWeatherData.html?b=FF.
However sometimes a distinction has to be made between CLI in interactive mode and in a script, batch mode, as sometimes programs behave differently depending on the mode.
Code: Select all
guest@porteus:~$ firefox -h
(process:2854): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Usage: firefox [ options ... ] [URL]
FF expects a URL. However before surmising a FF defect, FF has to be invoked with a proper URL, where special characters are properly encoded, as opposed to what goes in the
navigator bar.
Code: Select all
ff='file:///mnt/sda5/Users/Ed/My%20Webpages/EdsxoapWeatherData.html%3Fb=FF'
firefox "$ff"
End of Story.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB