Passed variable (e.g., %1) are now quoted?
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
- SizzlechestSA
- Newbie
- Posts: 5
- Joined: October 9th, 2008, 3:30 pm
Passed variable (e.g., %1) are now quoted?
I made a post-processing script a while back that uses %1. I noticed ever since I upgraded to 0.4.5 that the variable passes the directory with quotes around it. This breaks the script. Is it possible to turn this off? The scripts should be handling the quoting.
Re: Passed variable (e.g., %1) are now quoted?
What was the previous release you used?
- SizzlechestSA
- Newbie
- Posts: 5
- Joined: October 9th, 2008, 3:30 pm
Re: Passed variable (e.g., %1) are now quoted?
0.4.4shypike wrote: What was the previous release you used?
Re: Passed variable (e.g., %1) are now quoted?
There's no difference between 0.4.4 and 0.4.5 in this area.
Both versions put quotes around parameters that contain spaces, but
omit the quotes when no spaces are present.
This is standard behaviour of Windows + Python-libraries.
You can safely assume that you never need to put quotes around %x.
For Posix systems (Unix, Linux and OSX), the quotes are not present.
Both versions put quotes around parameters that contain spaces, but
omit the quotes when no spaces are present.
This is standard behaviour of Windows + Python-libraries.
You can safely assume that you never need to put quotes around %x.
For Posix systems (Unix, Linux and OSX), the quotes are not present.
- SizzlechestSA
- Newbie
- Posts: 5
- Joined: October 9th, 2008, 3:30 pm
Re: Passed variable (e.g., %1) are now quoted?
The problem with this is if you're writing a script that takes the variable and appends subfolders and/or filenames with spaces, it's not going to work.
I understand the quotes are not being put there by sabnzbd. However, I think it would be a good idea to strip them (if they exist) before the variables are passed to the command line. s/^"(.*)"$/\1/
I understand the quotes are not being put there by sabnzbd. However, I think it would be a good idea to strip them (if they exist) before the variables are passed to the command line. s/^"(.*)"$/\1/
Re: Passed variable (e.g., %1) are now quoted?
We cannot strip them.
mkdir d:"with spaces"
mkdir d:"with spaces"\hello
Works fine.
Not true, try this in command prompt:The problem with this is if you're writing a script that takes the variable and appends subfolders and/or filenames with spaces, it's not going to work.
mkdir d:"with spaces"
mkdir d:"with spaces"\hello
Works fine.
Re: Passed variable (e.g., %1) are now quoted?
Best trick to get rid of the quotes:
Code: Select all
set name=%1
set name=%name:"=%
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Passed variable (e.g., %1) are now quoted?
to be clear, windows NEEDS the quotes on the command line, otherwise e.g. param 1 could become params 1,2,3,4 and 5 - it would be impossible to sort out. This is not the fault of sabnzbd.
I can't remember an example, but you can sometimes get into trouble when you have multiple sets of quotes on some windows commands, so stripping the "" is by far the safest route to take.
I can't remember an example, but you can sometimes get into trouble when you have multiple sets of quotes on some windows commands, so stripping the "" is by far the safest route to take.