Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

help me understand?

Jul
532
10
I spent 30 minutes trying to figure out why this situation was failing ONLY for files who’s last character was a space [don’t ask] prior to their extension....

It all came down to ... UNQUOTE?!?!?!?!?!?!


Code:
>echo “%@unquote[4_Shut Up Already (different from Liberal Animation version) ]”
“4_Shut Up Already (different from Liberal Animation version)”

Really? @UNQUOTE strips spaces?!?!?!?! Or is this just an artifact of the way parameters are passed in general?


Oof. Things got ugly. Yup, all 3 sets of backticks were required:

1734894521042.webp




I guess that’s just life in the big city, huh?
 

Attachments

  • 1734894140037.webp
    1734894140037.webp
    16.8 KB · Views: 2
Feels bug-like, but I get that it may simply be a case of "nobody cared for 30 years"
 
Not sure why you're calling @UNQUOTE for strings which aren't quoted, but ...

The variable function expansion strips leading and trailing white space (because I've never been able to convince people not to pad everything).

Also, @UNQUOTE will remove leading & trailing spaces, tabs, and quotes.

If you don't have double quotes in the middle of your filenames (I hope you don't...) then you should use @UNQUOTES, which just removes enclosing double quotes but ignores all of those bad / invalid characters you have inserted into your filenames.
 
The variable function expansion strips leading and trailing white space (because I've never been able to convince people not to pad everything).
What variable expansion (@variables, surely not all of them), and leading/trailing white space where (in arguments, in all arguments)?
 
What variable expansion (@variables, surely not all of them), and leading/trailing white space where (in arguments, in all arguments)?

It varies from function to function. In the specific case of @UNQUOTE, Clio called it: trailing whitespace is trimmed, leading whitespace is untouched.
 
99% of the variable functions trim whitespace (it's actually done before the specific variable function is called). Perhaps a half-dozen or less don't, for reasons that the whitespace might be significant (like @REPLACE).

This is 30+ year old behavior, and there is not the remotest possibility it's going to change. There are few things I can think of that would be a more catastrophic breaking change.
 
It is what it is. Thanks for the great explanation!

`
 
Back
Top